aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2017-05-20 15:42:08 +0200
committerKostya Shishkov <kostya.shishkov@gmail.com>2017-05-20 15:42:08 +0200
commit34829caaa66f6842c2649fc0b4496a9d12454766 (patch)
tree2179427959001dbc10bdb62ee964674c192450d3 /src
parente5e85f326e9edbfdecb8e93a21834984ae201380 (diff)
downloadnihav-34829caaa66f6842c2649fc0b4496a9d12454766.tar.gz
minor register improvements
Diffstat (limited to 'src')
-rw-r--r--src/register.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/register.rs b/src/register.rs
index d4f72af..a3f3e45 100644
--- a/src/register.rs
+++ b/src/register.rs
@@ -1,6 +1,6 @@
use std::fmt;
-#[derive(Debug,Clone,Copy)]
+#[derive(Debug,Clone,Copy,PartialEq)]
#[allow(dead_code)]
pub enum CodecType {
Video,
@@ -28,6 +28,7 @@ const CODEC_CAP_REORDER:u32 = 0x000004;
const CODEC_CAP_HYBRID:u32 = 0x000008;
const CODEC_CAP_SCALABLE:u32 = 0x000010;
+#[derive(Clone)]
pub struct CodecDescription {
name: &'static str,
fname: &'static str,
@@ -108,9 +109,9 @@ macro_rules! desc {
}
pub fn get_codec_description(name: &str) -> Option<&'static CodecDescription> {
- for i in 0..CODEC_REGISTER.len() {
- if CODEC_REGISTER[i].name == name {
- return Some(&CODEC_REGISTER[i]);
+ for reg in CODEC_REGISTER {
+ if reg.name == name {
+ return Some(reg);
}
}
None