diff mbox

[FFmpeg-devel,3/3] ffprobe: use av_spherical_projection_name() to print spherical projection names

Message ID 20170329025557.952-3-jamrial@gmail.com
State Accepted
Commit 2a2854f57842e843ae0d4bd0ebe617135b2f63a0
Headers show

Commit Message

James Almer March 29, 2017, 2:55 a.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
 ffprobe.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

Comments

Vittorio Giovara March 31, 2017, 8:46 a.m. UTC | #1
On Wed, Mar 29, 2017 at 4:55 AM, James Almer <jamrial@gmail.com> wrote:
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  ffprobe.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/ffprobe.c b/ffprobe.c
> index 67c4ed40fa..be5583aea2 100644
> --- a/ffprobe.c
> +++ b/ffprobe.c
> @@ -1872,22 +1872,18 @@ static void print_pkt_side_data(WriterContext *w,
>              print_int("inverted", !!(stereo->flags & AV_STEREO3D_FLAG_INVERT));
>          } else if (sd->type == AV_PKT_DATA_SPHERICAL) {
>              const AVSphericalMapping *spherical = (AVSphericalMapping *)sd->data;
> -            if (spherical->projection == AV_SPHERICAL_EQUIRECTANGULAR)
> -                print_str("projection", "equirectangular");
> -            else if (spherical->projection == AV_SPHERICAL_CUBEMAP) {
> -                print_str("projection", "cubemap");
> +            print_str("projection", av_spherical_projection_name(spherical->projection));
> +            if (spherical->projection == AV_SPHERICAL_CUBEMAP) {
>                  print_int("padding", spherical->padding);
>              } else if (spherical->projection == AV_SPHERICAL_EQUIRECTANGULAR_TILE) {
>                  size_t l, t, r, b;
>                  av_spherical_tile_bounds(spherical, par->width, par->height,
>                                           &l, &t, &r, &b);
> -                print_str("projection", "tiled equirectangular");
>                  print_int("bound_left", l);
>                  print_int("bound_top", t);
>                  print_int("bound_right", r);
>                  print_int("bound_bottom", b);
> -            } else
> -                print_str("projection", "unknown");
> +            }
>
>              print_int("yaw", (double) spherical->yaw / (1 << 16));
>              print_int("pitch", (double) spherical->pitch / (1 << 16));
> --

lgtm
James Almer March 31, 2017, 5:17 p.m. UTC | #2
On 3/31/2017 5:46 AM, Vittorio Giovara wrote:
> On Wed, Mar 29, 2017 at 4:55 AM, James Almer <jamrial@gmail.com> wrote:
>> Signed-off-by: James Almer <jamrial@gmail.com>
>> ---
>>  ffprobe.c | 10 +++-------
>>  1 file changed, 3 insertions(+), 7 deletions(-)
>>
>> diff --git a/ffprobe.c b/ffprobe.c
>> index 67c4ed40fa..be5583aea2 100644
>> --- a/ffprobe.c
>> +++ b/ffprobe.c
>> @@ -1872,22 +1872,18 @@ static void print_pkt_side_data(WriterContext *w,
>>              print_int("inverted", !!(stereo->flags & AV_STEREO3D_FLAG_INVERT));
>>          } else if (sd->type == AV_PKT_DATA_SPHERICAL) {
>>              const AVSphericalMapping *spherical = (AVSphericalMapping *)sd->data;
>> -            if (spherical->projection == AV_SPHERICAL_EQUIRECTANGULAR)
>> -                print_str("projection", "equirectangular");
>> -            else if (spherical->projection == AV_SPHERICAL_CUBEMAP) {
>> -                print_str("projection", "cubemap");
>> +            print_str("projection", av_spherical_projection_name(spherical->projection));
>> +            if (spherical->projection == AV_SPHERICAL_CUBEMAP) {
>>                  print_int("padding", spherical->padding);
>>              } else if (spherical->projection == AV_SPHERICAL_EQUIRECTANGULAR_TILE) {
>>                  size_t l, t, r, b;
>>                  av_spherical_tile_bounds(spherical, par->width, par->height,
>>                                           &l, &t, &r, &b);
>> -                print_str("projection", "tiled equirectangular");
>>                  print_int("bound_left", l);
>>                  print_int("bound_top", t);
>>                  print_int("bound_right", r);
>>                  print_int("bound_bottom", b);
>> -            } else
>> -                print_str("projection", "unknown");
>> +            }
>>
>>              print_int("yaw", (double) spherical->yaw / (1 << 16));
>>              print_int("pitch", (double) spherical->pitch / (1 << 16));
>> --
> 
> lgtm

Pushed, thanks.
diff mbox

Patch

diff --git a/ffprobe.c b/ffprobe.c
index 67c4ed40fa..be5583aea2 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -1872,22 +1872,18 @@  static void print_pkt_side_data(WriterContext *w,
             print_int("inverted", !!(stereo->flags & AV_STEREO3D_FLAG_INVERT));
         } else if (sd->type == AV_PKT_DATA_SPHERICAL) {
             const AVSphericalMapping *spherical = (AVSphericalMapping *)sd->data;
-            if (spherical->projection == AV_SPHERICAL_EQUIRECTANGULAR)
-                print_str("projection", "equirectangular");
-            else if (spherical->projection == AV_SPHERICAL_CUBEMAP) {
-                print_str("projection", "cubemap");
+            print_str("projection", av_spherical_projection_name(spherical->projection));
+            if (spherical->projection == AV_SPHERICAL_CUBEMAP) {
                 print_int("padding", spherical->padding);
             } else if (spherical->projection == AV_SPHERICAL_EQUIRECTANGULAR_TILE) {
                 size_t l, t, r, b;
                 av_spherical_tile_bounds(spherical, par->width, par->height,
                                          &l, &t, &r, &b);
-                print_str("projection", "tiled equirectangular");
                 print_int("bound_left", l);
                 print_int("bound_top", t);
                 print_int("bound_right", r);
                 print_int("bound_bottom", b);
-            } else
-                print_str("projection", "unknown");
+            }
 
             print_int("yaw", (double) spherical->yaw / (1 << 16));
             print_int("pitch", (double) spherical->pitch / (1 << 16));