summaryrefslogtreecommitdiffstats
path: root/libhb/common.c
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2017-11-06 10:48:26 -0800
committerGitHub <[email protected]>2017-11-06 10:48:26 -0800
commit8a68af4675fd90f58ab0b8a191345847bff94cea (patch)
tree5f473c29873fe702e9d2177903557cbd6acb79c3 /libhb/common.c
parentd438e35c7edf9a94cddb7853fe68a50207d1027d (diff)
CLI: add option to log version, title, and progress in json
This is useful for scripts and other frontends that need to parse CLI output.
Diffstat (limited to 'libhb/common.c')
-rw-r--r--libhb/common.c45
1 files changed, 43 insertions, 2 deletions
diff --git a/libhb/common.c b/libhb/common.c
index 08bf0f08d..2ffa11b43 100644
--- a/libhb/common.c
+++ b/libhb/common.c
@@ -2040,6 +2040,22 @@ const hb_mixdown_t* hb_mixdown_get_next(const hb_mixdown_t *last)
return ((hb_mixdown_internal_t*)last)->next;
}
+void hb_layout_get_name(char * name, int size, int64_t layout)
+{
+ av_get_channel_layout_string(name, size, 0, layout);
+}
+
+int hb_layout_get_discrete_channel_count(int64_t layout)
+{
+ return av_get_channel_layout_nb_channels(layout);
+}
+
+int hb_layout_get_low_freq_channel_count(int64_t layout)
+{
+ return !!(layout & AV_CH_LOW_FREQUENCY) +
+ !!(layout & AV_CH_LOW_FREQUENCY_2);
+}
+
int hb_video_encoder_get_default(int muxer)
{
if (!(muxer & HB_MUX_MASK))
@@ -2532,6 +2548,31 @@ int hb_autopassthru_get_encoder(int in_codec, int copy_mask, int fallback,
fallback_result;
}
+const char* hb_audio_decoder_get_name(int codec, int codec_param)
+{
+ if (codec & HB_ACODEC_FF_MASK)
+ {
+ AVCodec * codec;
+
+ codec = avcodec_find_decoder(codec_param);
+ if (codec != NULL)
+ {
+ return codec->name;
+ }
+ }
+ else
+ {
+ switch (codec)
+ {
+ case HB_ACODEC_LPCM:
+ return "pcm_dvd";
+ default:
+ break;
+ }
+ }
+ return "unknown";
+}
+
hb_container_t* hb_container_get_from_format(int format)
{
int i;
@@ -5302,9 +5343,9 @@ const char * hb_subsource_name( int source )
case SRTSUB:
return "SRT";
case CC608SUB:
- return "CC";
+ return "CC608";
case CC708SUB:
- return "CC";
+ return "CC708";
case UTF8SUB:
return "UTF-8";
case TX3GSUB: