diff mbox

[FFmpeg-devel,2/3] ffprobe: add support for ICC Profile frame side data

Message ID 20170726043124.6296-2-jamrial@gmail.com
State New
Headers show

Commit Message

James Almer July 26, 2017, 4:31 a.m. UTC
Print the name metadata entry and the buffer size.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 ffprobe.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Rostislav Pehlivanov July 26, 2017, 6:10 a.m. UTC | #1
On 26 July 2017 at 05:31, James Almer <jamrial@gmail.com> wrote:

> Print the name metadata entry and the buffer size.
>
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  ffprobe.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/ffprobe.c b/ffprobe.c
> index 3d9f795d2e..b4947df6e0 100644
> --- a/ffprobe.c
> +++ b/ffprobe.c
> @@ -2190,6 +2190,11 @@ static void show_frame(WriterContext *w, AVFrame
> *frame, AVStream *stream,
>                  AVContentLightMetadata *metadata =
> (AVContentLightMetadata *)sd->data;
>                  print_int("max_content", metadata->MaxCLL);
>                  print_int("max_average", metadata->MaxFALL);
> +            } else if (sd->type == AV_FRAME_DATA_ICC_PROFILE) {
> +                AVDictionaryEntry *t = av_dict_get(sd->metadata, "name",
> NULL, AV_DICT_MATCH_CASE);
>

small nit: using a single letter variable for something like this


> +                if (t)
> +                    print_str("name", t->value);
> +                print_int("size", sd->size);
>              }
>              writer_print_section_footer(w);
>          }
> --
> 2.13.3
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

Small nit aside, patch LGTM, tnx
James Almer July 26, 2017, 2:34 p.m. UTC | #2
On 7/26/2017 3:10 AM, Rostislav Pehlivanov wrote:
> On 26 July 2017 at 05:31, James Almer <jamrial@gmail.com> wrote:
> 
>> Print the name metadata entry and the buffer size.
>>
>> Signed-off-by: James Almer <jamrial@gmail.com>
>> ---
>>  ffprobe.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/ffprobe.c b/ffprobe.c
>> index 3d9f795d2e..b4947df6e0 100644
>> --- a/ffprobe.c
>> +++ b/ffprobe.c
>> @@ -2190,6 +2190,11 @@ static void show_frame(WriterContext *w, AVFrame
>> *frame, AVStream *stream,
>>                  AVContentLightMetadata *metadata =
>> (AVContentLightMetadata *)sd->data;
>>                  print_int("max_content", metadata->MaxCLL);
>>                  print_int("max_average", metadata->MaxFALL);
>> +            } else if (sd->type == AV_FRAME_DATA_ICC_PROFILE) {
>> +                AVDictionaryEntry *t = av_dict_get(sd->metadata, "name",
>> NULL, AV_DICT_MATCH_CASE);
>>
> 
> small nit: using a single letter variable for something like this

Changed to tag.

> 
> 
>> +                if (t)
>> +                    print_str("name", t->value);
>> +                print_int("size", sd->size);
>>              }
>>              writer_print_section_footer(w);
>>          }
>> --
>> 2.13.3
>>
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
> 
> Small nit aside, patch LGTM, tnx

Pushed.
diff mbox

Patch

diff --git a/ffprobe.c b/ffprobe.c
index 3d9f795d2e..b4947df6e0 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -2190,6 +2190,11 @@  static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
                 AVContentLightMetadata *metadata = (AVContentLightMetadata *)sd->data;
                 print_int("max_content", metadata->MaxCLL);
                 print_int("max_average", metadata->MaxFALL);
+            } else if (sd->type == AV_FRAME_DATA_ICC_PROFILE) {
+                AVDictionaryEntry *t = av_dict_get(sd->metadata, "name", NULL, AV_DICT_MATCH_CASE);
+                if (t)
+                    print_str("name", t->value);
+                print_int("size", sd->size);
             }
             writer_print_section_footer(w);
         }