diff options
author | jstebbins <[email protected]> | 2015-04-02 16:04:08 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2015-04-02 16:04:08 +0000 |
commit | 4e26c6488ca8910d834568d22c89b34c239798c7 (patch) | |
tree | 6e03aa4a9aa471f1f97ee468f2412f306ee4145b /libhb/common.c | |
parent | 7853e46f29f9379fcfbeda917101819c37f1a7eb (diff) |
libhb: add functions to lookup details of mixdown, video, audio, container
... from int id.
And add defines to eliminate some magic numbers.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7037 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/common.c')
-rw-r--r-- | libhb/common.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/libhb/common.c b/libhb/common.c index f38444648..7d97a0da0 100644 --- a/libhb/common.c +++ b/libhb/common.c @@ -1671,6 +1671,20 @@ int hb_mixdown_get_default(uint32_t codec, uint64_t layout) return hb_mixdown_get_best(codec, layout, mixdown); } +hb_mixdown_t* hb_mixdown_get_from_mixdown(int mixdown) +{ + int i; + for (i = 0; i < hb_audio_mixdowns_count; i++) + { + if (hb_audio_mixdowns[i].item.amixdown == mixdown) + { + return &hb_audio_mixdowns[i].item; + } + } + + return NULL; +} + int hb_mixdown_get_from_name(const char *name) { if (name == NULL || *name == '\0') @@ -1760,6 +1774,20 @@ fail: return 0; } +hb_encoder_t * hb_video_encoder_get_from_codec(int codec) +{ + int i; + for (i = 0; i < hb_video_encoders_count; i++) + { + if (hb_video_encoders[i].item.codec == codec) + { + return &hb_video_encoders[i].item; + } + } + + return NULL; +} + int hb_video_encoder_get_from_name(const char *name) { if (name == NULL || *name == '\0') @@ -1927,6 +1955,20 @@ fail: return 0; } +hb_encoder_t* hb_audio_encoder_get_from_codec(int codec) +{ + int i; + for (i = 0; i < hb_audio_encoders_count; i++) + { + if (hb_audio_encoders[i].item.codec == codec) + { + return &hb_audio_encoders[i].item; + } + } + + return 0; +} + int hb_audio_encoder_get_from_name(const char *name) { if (name == NULL || *name == '\0') @@ -2208,6 +2250,20 @@ int hb_autopassthru_get_encoder(int in_codec, int copy_mask, int fallback, return (out_codec & HB_ACODEC_PASS_MASK) ? out_codec : fallback; } +hb_container_t* hb_container_get_from_format(int format) +{ + int i; + for (i = 0; i < hb_containers_count; i++) + { + if (hb_containers[i].item.format == format) + { + return &hb_containers[i].item; + } + } + + return NULL; +} + int hb_container_get_from_name(const char *name) { if (name == NULL || *name == '\0') |