diff mbox

[FFmpeg-devel] ffprobe: Print color properties from show_frames

Message ID 20170720123827.38649-1-vittorio.giovara@gmail.com
State Superseded
Headers show

Commit Message

Vittorio Giovara July 20, 2017, 12:38 p.m. UTC
---
 ffprobe.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Tobias Rapp July 20, 2017, 1:44 p.m. UTC | #1
On 20.07.2017 14:38, Vittorio Giovara wrote:
> ---
>  ffprobe.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/ffprobe.c b/ffprobe.c
> index f6d9be0df9..412e2dadab 100644
> --- a/ffprobe.c
> +++ b/ffprobe.c
> @@ -2105,6 +2105,12 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
>          print_int("interlaced_frame",       frame->interlaced_frame);
>          print_int("top_field_first",        frame->top_field_first);
>          print_int("repeat_pict",            frame->repeat_pict);
> +
> +        print_str("color_range",     av_color_range_name(frame->color_range));
> +        print_str("color_space",     av_color_space_name(frame->colorspace));
> +        print_str("color_primaries", av_color_primaries_name(frame->color_primaries));
> +        print_str("color_transfer",  av_color_transfer_name(frame->color_trc));
> +        print_str("chroma_location", av_chroma_location_name(frame->chroma_location));

I guess this should look like

if (frame->... != ..._UNSPECIFIED)
     print_str(...);
else
     print_str_opt(...);

see the similar code lines handling color properties on stream level (~ 
line #2475).

>          break;
>
>      case AVMEDIA_TYPE_AUDIO:
>

The schema file at doc/ffprobe.xsd should be updated to reflect the new 
fields.

Also I assume that some FATE references are changed by this patch?

Best regards,
Tobias
diff mbox

Patch

diff --git a/ffprobe.c b/ffprobe.c
index f6d9be0df9..412e2dadab 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -2105,6 +2105,12 @@  static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
         print_int("interlaced_frame",       frame->interlaced_frame);
         print_int("top_field_first",        frame->top_field_first);
         print_int("repeat_pict",            frame->repeat_pict);
+
+        print_str("color_range",     av_color_range_name(frame->color_range));
+        print_str("color_space",     av_color_space_name(frame->colorspace));
+        print_str("color_primaries", av_color_primaries_name(frame->color_primaries));
+        print_str("color_transfer",  av_color_transfer_name(frame->color_trc));
+        print_str("chroma_location", av_chroma_location_name(frame->chroma_location));
         break;
 
     case AVMEDIA_TYPE_AUDIO: