diff mbox

[FFmpeg-devel,3/4] lavc/utils: avcodec_string: dump field order when known

Message ID 20161004044939.22351-3-rodger.combs@gmail.com
State Accepted
Headers show

Commit Message

Rodger Combs Oct. 4, 2016, 4:49 a.m. UTC
---
 libavcodec/utils.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

Comments

Michael Niedermayer Oct. 5, 2016, 7:06 p.m. UTC | #1
On Mon, Oct 03, 2016 at 11:49:38PM -0500, Rodger Combs wrote:
> ---
>  libavcodec/utils.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)

LGTM

thx

[...]
Tobias Rapp Oct. 6, 2016, 2:05 p.m. UTC | #2
On 04.10.2016 06:49, Rodger Combs wrote:
> ---
>  libavcodec/utils.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>
> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> index 6f4df93..a0931c6 100644
> --- a/libavcodec/utils.c
> +++ b/libavcodec/utils.c
> @@ -3228,6 +3228,21 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
>                                  av_get_colorspace_name(enc->colorspace));
>              }
>
> +            if (enc->field_order != AV_FIELD_UNKNOWN) {
> +                const char *field_order = "progressive";
> +                if (enc->field_order == AV_FIELD_TT)
> +                    field_order = "top first";
> +                else if (enc->field_order == AV_FIELD_BB)
> +                    field_order = "bottom first";
> +                else if (enc->field_order == AV_FIELD_TB)
> +                    field_order = "top coded first, swapped";
> +                else if (enc->field_order == AV_FIELD_BT)
> +                    field_order = "bottom coded first, swapped";

In the list of comma-separated information tokens it might not be 
obvious to the user that ", swapped" semantically belongs to the 
preceding "top coded first". What about "top coded first (swapped)" and 
"bottom coded first (swapped)"?

Just my personal feeling.

> +
> +                av_strlcatf(detail, sizeof(detail), "%s, ", field_order);
> +            }
> +
> +
>              if (av_log_get_level() >= AV_LOG_DEBUG &&
>                  enc->chroma_sample_location != AVCHROMA_LOC_UNSPECIFIED)
>                  av_strlcatf(detail, sizeof(detail), "%s, ",
>

Regards,
Tobias
diff mbox

Patch

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 6f4df93..a0931c6 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -3228,6 +3228,21 @@  void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
                                 av_get_colorspace_name(enc->colorspace));
             }
 
+            if (enc->field_order != AV_FIELD_UNKNOWN) {
+                const char *field_order = "progressive";
+                if (enc->field_order == AV_FIELD_TT)
+                    field_order = "top first";
+                else if (enc->field_order == AV_FIELD_BB)
+                    field_order = "bottom first";
+                else if (enc->field_order == AV_FIELD_TB)
+                    field_order = "top coded first, swapped";
+                else if (enc->field_order == AV_FIELD_BT)
+                    field_order = "bottom coded first, swapped";
+
+                av_strlcatf(detail, sizeof(detail), "%s, ", field_order);
+            }
+
+
             if (av_log_get_level() >= AV_LOG_DEBUG &&
                 enc->chroma_sample_location != AVCHROMA_LOC_UNSPECIFIED)
                 av_strlcatf(detail, sizeof(detail), "%s, ",