[FFmpeg-cvslog] cmdutils: move get_rotation() up in the file

James Almer git at videolan.org
Tue May 5 07:48:24 CEST 2015


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Tue May  5 02:46:42 2015 -0300| [858f81fde2c1755b5471eb0e176c81ebb8cbbc83] | committer: James Almer

cmdutils: move get_rotation() up in the file

Fixes compilation of fftools without libavdevice

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=858f81fde2c1755b5471eb0e176c81ebb8cbbc83
---

 cmdutils.c |   48 ++++++++++++++++++++++++------------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/cmdutils.c b/cmdutils.c
index 050b992..052cba0 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -2074,6 +2074,30 @@ void *grow_array(void *array, int elem_size, int *size, int new_size)
     return array;
 }
 
+double get_rotation(AVStream *st)
+{
+    AVDictionaryEntry *rotate_tag = av_dict_get(st->metadata, "rotate", NULL, 0);
+    uint8_t* displaymatrix = av_stream_get_side_data(st,
+                                                     AV_PKT_DATA_DISPLAYMATRIX, NULL);
+    double theta = 0;
+
+    if (rotate_tag && *rotate_tag->value && strcmp(rotate_tag->value, "0")) {
+        char *tail;
+        theta = av_strtod(rotate_tag->value, &tail);
+        if (*tail)
+            theta = 0;
+    }
+    if (displaymatrix && !theta)
+        theta = av_display_rotation_get((int32_t*) displaymatrix);
+
+    theta -= 360*floor(theta/360 + 0.9/360);
+
+    if (fabs(theta - 90*round(theta/90)) > 2)
+        av_log_ask_for_sample(NULL, "Odd rotation angle\n");
+
+    return theta;
+}
+
 #if CONFIG_AVDEVICE
 static int print_device_sources(AVInputFormat *fmt, AVDictionary *opts)
 {
@@ -2231,28 +2255,4 @@ int show_sinks(void *optctx, const char *opt, const char *arg)
     return ret;
 }
 
-double get_rotation(AVStream *st)
-{
-    AVDictionaryEntry *rotate_tag = av_dict_get(st->metadata, "rotate", NULL, 0);
-    uint8_t* displaymatrix = av_stream_get_side_data(st,
-                                                     AV_PKT_DATA_DISPLAYMATRIX, NULL);
-    double theta = 0;
-
-    if (rotate_tag && *rotate_tag->value && strcmp(rotate_tag->value, "0")) {
-        char *tail;
-        theta = av_strtod(rotate_tag->value, &tail);
-        if (*tail)
-            theta = 0;
-    }
-    if (displaymatrix && !theta)
-        theta = av_display_rotation_get((int32_t*) displaymatrix);
-
-    theta -= 360*floor(theta/360 + 0.9/360);
-
-    if (fabs(theta - 90*round(theta/90)) > 2)
-        av_log_ask_for_sample(NULL, "Odd rotation angle\n");
-
-    return theta;
-}
-
 #endif



More information about the ffmpeg-cvslog mailing list