From fe226e7a7754e8824d0e70479fd1b6945fc4904c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 11 Apr 2011 10:06:53 +0100 Subject: [PATCH 01/21] tag: fix typo in ID3 genres MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit psychadelic -> psychedelic. Spotted by Sébastien Wilmet. https://bugzilla.gnome.org/show_bug.cgi?id=647399 --- gst-libs/gst/tag/gstid3tag.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/tag/gstid3tag.c b/gst-libs/gst/tag/gstid3tag.c index 8c9b352643..2c3c66147d 100644 --- a/gst-libs/gst/tag/gstid3tag.c +++ b/gst-libs/gst/tag/gstid3tag.c @@ -109,7 +109,7 @@ static const gchar *genres[] = { "Native American", "Cabaret", "New Wave", - "Psychadelic", + "Psychedelic", "Rave", "Showtunes", "Trailer", @@ -135,7 +135,7 @@ static const gchar *genres[] = { "Avantgarde", "Gothic Rock", "Progressive Rock", - "Psychadelic Rock", + "Psychedelic Rock", "Symphonic Rock", "Slow Rock", "Big Band", From eb10995895bdcafa9ad337370b1da5cd1df3b853 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Mon, 11 Apr 2011 15:02:38 +0200 Subject: [PATCH 02/21] videorate: empty caps have no structure to pick --- gst/videorate/gstvideorate.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gst/videorate/gstvideorate.c b/gst/videorate/gstvideorate.c index 2797d8ab47..4f53c81388 100644 --- a/gst/videorate/gstvideorate.c +++ b/gst/videorate/gstvideorate.c @@ -340,6 +340,12 @@ gst_video_rate_setcaps (GstPad * pad, GstCaps * caps) GST_DEBUG_OBJECT (videorate, "intersect %" GST_PTR_FORMAT, caps); + /* could turn up empty, due to e.g. colorspace etc */ + if (gst_caps_get_size (caps) == 0) { + gst_caps_unref (caps); + goto no_transform; + } + /* take first possibility */ gst_caps_truncate (caps); structure = gst_caps_get_structure (caps, 0); From 53ed1333549d7aab2babec0661a8482695db249d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 11 Apr 2011 14:29:35 +0100 Subject: [PATCH 03/21] tests: dist all struct_*.h files for libs ABI test Should fix distcheck on x86_64. --- tests/check/Makefile.am | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am index 9a9a962296..e0b159dc49 100644 --- a/tests/check/Makefile.am +++ b/tests/check/Makefile.am @@ -171,13 +171,7 @@ VALGRIND_TO_FIX = \ noinst_PROGRAMS = $(check_libvisual) noinst_HEADERS = \ - libs/struct_i386.h -# libs/struct_arm.h \ -# libs/struct_hppa.h \ -# libs/struct_ppc32.h \ -# libs/struct_ppc64.h \ -# libs/struct_sparc.h \ -# libs/struct_x86_64.h + libs/struct_*.h AM_CFLAGS = -I$(top_srcdir)/gst-libs -I$(top_builddir)/gst-libs \ $(GST_CFLAGS) $(GST_CHECK_CFLAGS) \ From 3fa0119dc13f8861f68f8b7b108ce137e3508d53 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 6 Apr 2011 16:27:54 +0100 Subject: [PATCH 04/21] encoding-profile: fix unused-but-set-variable warnings with gcc 4.6 Top-level profiles don't have restrictions, only stream profiles, so no need to serialise that here. https://bugzilla.gnome.org/show_bug.cgi?id=646925 --- gst-libs/gst/pbutils/encoding-target.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/gst-libs/gst/pbutils/encoding-target.c b/gst-libs/gst/pbutils/encoding-target.c index b7e7ad545b..29e67d06a0 100644 --- a/gst-libs/gst/pbutils/encoding-target.c +++ b/gst-libs/gst/pbutils/encoding-target.c @@ -448,21 +448,19 @@ serialize_encoding_profile (GKeyFile * out, GstEncodingProfile * prof) const GList *tmp; guint i; const gchar *profname, *profdesc, *profpreset, *proftype; - const GstCaps *profformat, *profrestriction; + const GstCaps *profformat; profname = gst_encoding_profile_get_name (prof); profdesc = gst_encoding_profile_get_description (prof); profformat = gst_encoding_profile_get_format (prof); profpreset = gst_encoding_profile_get_preset (prof); proftype = gst_encoding_profile_get_type_nick (prof); - profrestriction = gst_encoding_profile_get_restriction (prof); profgroupname = g_strdup_printf ("profile-%s", profname); g_key_file_set_string (out, profgroupname, "name", profname); - g_key_file_set_value (out, profgroupname, "type", - gst_encoding_profile_get_type_nick (prof)); + g_key_file_set_value (out, profgroupname, "type", proftype); if (profdesc) { gchar *locale; @@ -1001,7 +999,6 @@ gst_encoding_target_save (GstEncodingTarget * target, GError ** error) { gchar *filename; gchar *lfilename; - gboolean res; g_return_val_if_fail (GST_IS_ENCODING_TARGET (target), FALSE); g_return_val_if_fail (target->category != NULL, FALSE); @@ -1012,7 +1009,7 @@ gst_encoding_target_save (GstEncodingTarget * target, GError ** error) GST_ENCODING_TARGET_DIRECTORY, target->category, lfilename, NULL); g_free (lfilename); - res = gst_encoding_target_save_to_file (target, filename, error); + gst_encoding_target_save_to_file (target, filename, error); g_free (filename); return TRUE; From fecd4a115405933a2c837ae0e10770c338adbbe6 Mon Sep 17 00:00:00 2001 From: Sreerenj Balachandran Date: Wed, 6 Apr 2011 22:57:41 +0300 Subject: [PATCH 05/21] rtsptranport: ensure valid int result when parsing ranges Specifically, make sure that the return value of strtol is falling in between the range of G_MININT and G_MAXINT. Fixes #646952. --- gst-libs/gst/rtsp/gstrtsptransport.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/gst-libs/gst/rtsp/gstrtsptransport.c b/gst-libs/gst/rtsp/gstrtsptransport.c index ad1b8e21ad..de3085ed31 100644 --- a/gst-libs/gst/rtsp/gstrtsptransport.c +++ b/gst-libs/gst/rtsp/gstrtsptransport.c @@ -269,6 +269,20 @@ parse_mode (GstRTSPTransport * transport, const gchar * str) transport->mode_record = (strstr (str, "record") != NULL); } +static gboolean +check_range (const gchar * str, gchar ** tmp, gint * range) +{ + glong range_val; + + range_val = strtol (str, tmp, 10); + if (range_val >= G_MININT && range_val <= G_MAXINT) { + *range = range_val; + return TRUE; + } else { + return FALSE; + } +} + static gboolean parse_range (const gchar * str, GstRTSPRange * range) { @@ -286,16 +300,14 @@ parse_range (const gchar * str, GstRTSPRange * range) if (g_ascii_isspace (minus[1]) || minus[1] == '+' || minus[1] == '-') goto invalid_range; - range->min = strtol (str, &tmp, 10); - if (str == tmp || tmp != minus) + if (!check_range (str, &tmp, &range->min) || str == tmp || tmp != minus) goto invalid_range; - range->max = strtol (minus + 1, &tmp, 10); - if (*tmp && *tmp != ';') + if (!check_range (minus + 1, &tmp, &range->max) || (*tmp && *tmp != ';')) goto invalid_range; } else { - range->min = strtol (str, &tmp, 10); - if (str == tmp || (*tmp && *tmp != ';')) + if (!check_range (str, &tmp, &range->min) || str == tmp || + (*tmp && *tmp != ';')) goto invalid_range; range->max = -1; From bf2b14f8608413fb3cd41215fa5c8fd46d4d597f Mon Sep 17 00:00:00 2001 From: Marc Plano-Lesay Date: Sat, 9 Apr 2011 19:15:23 +0200 Subject: [PATCH 06/21] fix unused-but-set-variable warnings with gcc 4.6 https://bugzilla.gnome.org/show_bug.cgi?id=647294 --- gst/playback/gstplaybasebin.c | 8 ++------ gst/subparse/tmplayerparse.c | 2 -- gst/tcp/gstmultifdsink.c | 12 +++++------- gst/videoscale/vs_image.c | 9 --------- 4 files changed, 7 insertions(+), 24 deletions(-) diff --git a/gst/playback/gstplaybasebin.c b/gst/playback/gstplaybasebin.c index 530d4011dc..847e12ff71 100644 --- a/gst/playback/gstplaybasebin.c +++ b/gst/playback/gstplaybasebin.c @@ -425,7 +425,6 @@ group_commit (GstPlayBaseBin * play_base_bin, gboolean fatal, gboolean subtitle) { GstPlayBaseGroup *group; gboolean had_active_group; - gboolean res; GROUP_LOCK (play_base_bin); group = play_base_bin->building_group; @@ -486,8 +485,7 @@ group_commit (GstPlayBaseBin * play_base_bin, gboolean fatal, gboolean subtitle) setup_substreams (play_base_bin); GST_DEBUG_OBJECT (play_base_bin, "Emitting signal"); - res = - GST_PLAY_BASE_BIN_GET_CLASS (play_base_bin)->setup_output_pads + GST_PLAY_BASE_BIN_GET_CLASS (play_base_bin)->setup_output_pads (play_base_bin, group); GST_DEBUG_OBJECT (play_base_bin, "done"); @@ -1167,7 +1165,6 @@ probe_triggered (GstPad * pad, GstEvent * event, gpointer user_data) GstPlayBaseGroup *group; GstPlayBaseBin *play_base_bin; GstStreamInfo *info; - gboolean res; GstEventType type; type = GST_EVENT_TYPE (event); @@ -1231,8 +1228,7 @@ probe_triggered (GstPad * pad, GstEvent * event, gpointer user_data) setup_substreams (play_base_bin); GST_DEBUG ("switching to next group %p - emitting signal", group); /* and signal the new group */ - res = - GST_PLAY_BASE_BIN_GET_CLASS (play_base_bin)->setup_output_pads + GST_PLAY_BASE_BIN_GET_CLASS (play_base_bin)->setup_output_pads (play_base_bin, group); GROUP_UNLOCK (play_base_bin); diff --git a/gst/subparse/tmplayerparse.c b/gst/subparse/tmplayerparse.c index 8f48c6e9d4..3937de6f3a 100644 --- a/gst/subparse/tmplayerparse.c +++ b/gst/subparse/tmplayerparse.c @@ -84,7 +84,6 @@ tmplayer_parse_line (ParserState * state, const gchar * line, guint line_num) { GstClockTime ts = GST_CLOCK_TIME_NONE; const gchar *text_start = NULL; - gboolean multiline = FALSE; gchar *ret = NULL; gchar divc = '\0'; guint h, m, s, l = 1; @@ -94,7 +93,6 @@ tmplayer_parse_line (ParserState * state, const gchar * line, guint line_num) GST_LOG ("multiline format %u %u %u %u", h, m, s, l); ts = GST_SECOND * ((((h * 60) + m) * 60) + s); text_start = strchr (line, '='); - multiline = TRUE; } else if (sscanf (line, "%u:%02u:%02u%c", &h, &m, &s, &divc) == 4 && (divc == '=' || divc == ':')) { GST_LOG ("single line format %u %u %u %u %c", h, m, s, l, divc); diff --git a/gst/tcp/gstmultifdsink.c b/gst/tcp/gstmultifdsink.c index 00cff05ec8..4e091e3be4 100644 --- a/gst/tcp/gstmultifdsink.c +++ b/gst/tcp/gstmultifdsink.c @@ -821,7 +821,7 @@ gst_multi_fd_sink_add_full (GstMultiFdSink * sink, int fd, GstTCPClient *client; GList *clink; GTimeVal now; - gint flags, res; + gint flags; struct stat statbuf; GST_DEBUG_OBJECT (sink, "[fd %5d] adding client, sync_method %d, " @@ -876,7 +876,7 @@ gst_multi_fd_sink_add_full (GstMultiFdSink * sink, int fd, sink->clients_cookie++; /* set the socket to non blocking */ - res = fcntl (fd, F_SETFL, O_NONBLOCK); + fcntl (fd, F_SETFL, O_NONBLOCK); /* we always read from a client */ gst_poll_add_fd (sink->fdset, &client->fd); @@ -888,7 +888,7 @@ gst_multi_fd_sink_add_full (GstMultiFdSink * sink, int fd, } } /* figure out the mode, can't use send() for non sockets */ - res = fstat (fd, &statbuf); + fstat (fd, &statbuf); if (S_ISSOCK (statbuf.st_mode)) { client->is_socket = TRUE; setup_dscp_client (sink, client); @@ -1865,7 +1865,6 @@ gst_multi_fd_sink_new_client (GstMultiFdSink * sink, GstTCPClient * client) } case GST_SYNC_METHOD_BURST_KEYFRAME: { - gboolean ok; gint min_idx, max_idx; gint next_syncframe, prev_syncframe; @@ -1877,7 +1876,7 @@ gst_multi_fd_sink_new_client (GstMultiFdSink * sink, GstTCPClient * client) * NEXT_KEYFRAME. */ /* gather burst limits */ - ok = count_burst_unit (sink, &min_idx, client->burst_min_unit, + count_burst_unit (sink, &min_idx, client->burst_min_unit, client->burst_min_value, &max_idx, client->burst_max_unit, client->burst_max_value); @@ -1914,7 +1913,6 @@ gst_multi_fd_sink_new_client (GstMultiFdSink * sink, GstTCPClient * client) } case GST_SYNC_METHOD_BURST_WITH_KEYFRAME: { - gboolean ok; gint min_idx, max_idx; gint next_syncframe; @@ -1925,7 +1923,7 @@ gst_multi_fd_sink_new_client (GstMultiFdSink * sink, GstTCPClient * client) * amount of data up 'till min. */ /* gather enough data to burst */ - ok = count_burst_unit (sink, &min_idx, client->burst_min_unit, + count_burst_unit (sink, &min_idx, client->burst_min_unit, client->burst_min_value, &max_idx, client->burst_max_unit, client->burst_max_value); diff --git a/gst/videoscale/vs_image.c b/gst/videoscale/vs_image.c index bff8ac767c..691914453f 100644 --- a/gst/videoscale/vs_image.c +++ b/gst/videoscale/vs_image.c @@ -85,7 +85,6 @@ vs_image_scale_linear_RGBA (const VSImage * dest, const VSImage * src, int y_increment; int x_increment; int y1; - int y2; int i; int j; int x; @@ -106,7 +105,6 @@ vs_image_scale_linear_RGBA (const VSImage * dest, const VSImage * src, #define LINE(x) ((tmpbuf) + (dest_size)*((x)&1)) acc = 0; - y2 = -1; gst_videoscale_orc_resample_bilinear_u32 (LINE (0), src->pixels, 0, x_increment, dest->width); y1 = 0; @@ -574,7 +572,6 @@ vs_image_scale_linear_Y (const VSImage * dest, const VSImage * src, int j; int x; int dest_size; - int xacc; if (dest->height == 1) y_increment = 0; @@ -592,7 +589,6 @@ vs_image_scale_linear_Y (const VSImage * dest, const VSImage * src, tmp2 = tmpbuf + dest_size; acc = 0; - xacc = 0; y2 = -1; gst_videoscale_orc_resample_bilinear_u8 (tmp1, src->pixels, 0, x_increment, dest->width); @@ -607,7 +603,6 @@ vs_image_scale_linear_Y (const VSImage * dest, const VSImage * src, } else if (j == y2) { memcpy (dest->pixels + i * dest->stride, tmp2, dest_size); } else { - xacc = 0; gst_videoscale_orc_resample_bilinear_u8 (tmp1, src->pixels + j * src->stride, 0, x_increment, dest->width); y1 = j; @@ -616,7 +611,6 @@ vs_image_scale_linear_Y (const VSImage * dest, const VSImage * src, } else { if (j == y1) { if (j + 1 != y2) { - xacc = 0; gst_videoscale_orc_resample_bilinear_u8 (tmp2, src->pixels + (j + 1) * src->stride, 0, x_increment, dest->width); y2 = j + 1; @@ -629,7 +623,6 @@ vs_image_scale_linear_Y (const VSImage * dest, const VSImage * src, } } else if (j == y2) { if (j + 1 != y1) { - xacc = 0; gst_videoscale_orc_resample_bilinear_u8 (tmp1, src->pixels + (j + 1) * src->stride, 0, x_increment, dest->width); y1 = j + 1; @@ -1098,7 +1091,6 @@ vs_image_scale_linear_AYUV64 (const VSImage * dest, const VSImage * src, int y_increment; int x_increment; int y1; - int y2; int i; int j; int x; @@ -1121,7 +1113,6 @@ vs_image_scale_linear_AYUV64 (const VSImage * dest, const VSImage * src, #define LINE(x) ((guint16 *)((tmpbuf) + (dest_size)*((x)&1))) acc = 0; - y2 = -1; //gst_videoscale_orc_resample_bilinear_u64 (LINE (0), src->pixels, // 0, x_increment, dest->width); xacc = 0; From a90adccacd736ad875cf6e462635ced50a51dd58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 12 Apr 2011 12:20:43 +0100 Subject: [PATCH 07/21] multifdsink: do check return values of fcntl() and fstat() https://bugzilla.gnome.org/show_bug.cgi?id=647294 --- gst/tcp/gstmultifdsink.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gst/tcp/gstmultifdsink.c b/gst/tcp/gstmultifdsink.c index 4e091e3be4..98c62d771a 100644 --- a/gst/tcp/gstmultifdsink.c +++ b/gst/tcp/gstmultifdsink.c @@ -876,7 +876,11 @@ gst_multi_fd_sink_add_full (GstMultiFdSink * sink, int fd, sink->clients_cookie++; /* set the socket to non blocking */ - fcntl (fd, F_SETFL, O_NONBLOCK); + if (fcntl (fd, F_SETFL, O_NONBLOCK) < 0) { + GST_ERROR_OBJECT (sink, "failed to make socket %d non-blocking: %s", fd, + g_strerror (errno)); + } + /* we always read from a client */ gst_poll_add_fd (sink->fdset, &client->fd); @@ -888,8 +892,7 @@ gst_multi_fd_sink_add_full (GstMultiFdSink * sink, int fd, } } /* figure out the mode, can't use send() for non sockets */ - fstat (fd, &statbuf); - if (S_ISSOCK (statbuf.st_mode)) { + if (fstat (fd, &statbuf) == 0 && S_ISSOCK (statbuf.st_mode)) { client->is_socket = TRUE; setup_dscp_client (sink, client); } From 8f1d77bc3c9555d2b7121c7e68e2e07bd824ee12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 12 Apr 2011 12:41:06 +0100 Subject: [PATCH 08/21] oggmux: fix uninitialised variable usage and element leak gcc on OSX complains about ret being used uninitialized in this function, and it is right. Don't leak element ref when returning early because newsegment event is not in TIME format. --- ext/ogg/gstoggmux.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/ogg/gstoggmux.c b/ext/ogg/gstoggmux.c index 437ebbff77..fc0aad248f 100644 --- a/ext/ogg/gstoggmux.c +++ b/ext/ogg/gstoggmux.c @@ -318,10 +318,9 @@ gst_ogg_mux_sink_event (GstPad * pad, GstEvent * event) { GstOggMux *ogg_mux = GST_OGG_MUX (gst_pad_get_parent (pad)); GstOggPadData *ogg_pad = (GstOggPadData *) gst_pad_get_element_private (pad); - gboolean ret; + gboolean ret = FALSE; - GST_DEBUG ("Got %s event on pad %s:%s", GST_EVENT_TYPE_NAME (event), - GST_DEBUG_PAD_NAME (pad)); + GST_DEBUG_OBJECT (pad, "Got %s event", GST_EVENT_TYPE_NAME (event)); switch (GST_EVENT_TYPE (event)) { case GST_EVENT_NEWSEGMENT:{ @@ -337,8 +336,10 @@ gst_ogg_mux_sink_event (GstPad * pad, GstEvent * event) /* We don't support non time NEWSEGMENT events */ if (format != GST_FORMAT_TIME) { gst_event_unref (event); - return FALSE; + event = NULL; + break; } + gst_segment_set_newsegment_full (&ogg_pad->segment, update, rate, applied_rate, format, start, stop, position); @@ -349,12 +350,11 @@ gst_ogg_mux_sink_event (GstPad * pad, GstEvent * event) break; } default: - ret = TRUE; break; } /* now GstCollectPads can take care of the rest, e.g. EOS */ - if (ret) + if (event != NULL) ret = ogg_pad->collect_event (pad, event); gst_object_unref (ogg_mux); From 49cc1718a827ab97a8bad13a4975339e65297961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 13 Apr 2011 09:10:52 +0100 Subject: [PATCH 09/21] docs: fix typo in video format docs --- gst-libs/gst/video/video.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst-libs/gst/video/video.h b/gst-libs/gst/video/video.h index 8f5cabfb76..fdd6b43a7f 100644 --- a/gst-libs/gst/video/video.h +++ b/gst-libs/gst/video/video.h @@ -70,7 +70,7 @@ G_BEGIN_DECLS * @GST_VIDEO_FORMAT_YVU9: planar 4:1:0 YUV (like YUV9 but UV planes swapped) (Since: 0.10.32) * @GST_VIDEO_FORMAT_IYU1: packed 4:1:1 YUV (Cb-Y0-Y1-Cr-Y2-Y3 ...) (Since: 0.10.32) * @GST_VIDEO_FORMAT_ARGB64: rgb with alpha channel first, 16 bits per channel (Since: 0.10.33) - * @GST_VIDEO_FORMAT_AY64: packed 4:4:4 YUV with alpha channel, 16 bits per channel (A0-Y0-U0-V0 ...) (Since: 0.10.33) + * @GST_VIDEO_FORMAT_AYUV64: packed 4:4:4 YUV with alpha channel, 16 bits per channel (A0-Y0-U0-V0 ...) (Since: 0.10.33) * @GST_VIDEO_FORMAT_r210: packed 4:4:4 RGB, 10 bits per channel (Since: 0.10.33) * * Enum value describing the most common video formats. From dd62fdc585902e59c375860c343480d71b6abc72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 13 Apr 2011 22:59:03 +0100 Subject: [PATCH 10/21] typefindfunctions: fix unused-but-set-variable warning with gcc 4.6 We don't compare the bitrates of consecutive mp3 frames on purpose here. https://bugzilla.gnome.org/show_bug.cgi?id=647294 --- gst/typefind/gsttypefindfunctions.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c index 4a24910cf7..98dbade0f5 100644 --- a/gst/typefind/gsttypefindfunctions.c +++ b/gst/typefind/gsttypefindfunctions.c @@ -1018,7 +1018,7 @@ mp3_type_find_at_offset (GstTypeFind * tf, guint64 start_off, while (found < GST_MP3_TYPEFIND_TRY_HEADERS) { guint32 head; guint length; - guint prev_layer = 0, prev_bitrate = 0; + guint prev_layer = 0; guint prev_channels = 0, prev_samplerate = 0; gboolean free = FALSE; @@ -1065,7 +1065,6 @@ mp3_type_find_at_offset (GstTypeFind * tf, guint64 start_off, * be a freaking funky encoded mp3 though. We'll just not count * this header*/ prev_layer = layer; - prev_bitrate = bitrate; prev_channels = channels; prev_samplerate = samplerate; } else { From f14c73cbfde9c5d3bc2b43d1f53325315c855825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 13 Apr 2011 23:19:07 +0100 Subject: [PATCH 11/21] ffmpegcolorspace: fix unused-but-set-variable warnings with gcc 4.6 https://bugzilla.gnome.org/show_bug.cgi?id=647294 --- gst/ffmpegcolorspace/imgconvert_template.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/ffmpegcolorspace/imgconvert_template.h b/gst/ffmpegcolorspace/imgconvert_template.h index fa0e8c240a..3b287e7933 100644 --- a/gst/ffmpegcolorspace/imgconvert_template.h +++ b/gst/ffmpegcolorspace/imgconvert_template.h @@ -2153,7 +2153,7 @@ static int glue (get_alpha_info_, RGB_NAME) (const AVPicture * src, { const unsigned char *p; int src_wrap, ret, x, y; - unsigned int r, g, b, a; + unsigned int G_GNUC_UNUSED r, G_GNUC_UNUSED g, G_GNUC_UNUSED b, a; p = src->data[0]; src_wrap = src->linesize[0] - BPP * width; From be597896646eea46c32549baae5bfb3ff03ccbc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 13 Apr 2011 23:57:56 +0100 Subject: [PATCH 12/21] ogg: fix unused-but-set-variable warnings with gcc 4.6 https://bugzilla.gnome.org/show_bug.cgi?id=647294 --- ext/ogg/gstoggdemux.c | 2 -- ext/ogg/gstoggmux.c | 4 +--- ext/ogg/gstoggstream.c | 12 ------------ 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index c01166502d..67d232137c 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -3087,14 +3087,12 @@ gst_ogg_demux_handle_page (GstOggDemux * ogg, ogg_page * page) pad = gst_ogg_demux_find_pad (ogg, serialno); } else { GstClockTime chain_time; - GstOggChain *current_chain; gint64 current_time; /* this can only happen in push mode */ if (ogg->pullmode) goto unknown_chain; - current_chain = ogg->current_chain; current_time = ogg->segment.last_stop; /* time of new chain is current time */ diff --git a/ext/ogg/gstoggmux.c b/ext/ogg/gstoggmux.c index fc0aad248f..9f3047f659 100644 --- a/ext/ogg/gstoggmux.c +++ b/ext/ogg/gstoggmux.c @@ -881,7 +881,6 @@ gst_ogg_mux_queue_pads (GstOggMux * ogg_mux) GST_DEBUG_OBJECT (data->pad, "EOS on pad"); if (!pad->eos) { ogg_page page; - GstFlowReturn ret; /* it's no longer active */ ogg_mux->active_pads--; @@ -891,8 +890,7 @@ gst_ogg_mux_queue_pads (GstOggMux * ogg_mux) while (ogg_stream_flush (&pad->map.stream, &page)) { /* Place page into the per-pad queue */ - ret = gst_ogg_mux_pad_queue_page (ogg_mux, pad, &page, - pad->first_delta); + gst_ogg_mux_pad_queue_page (ogg_mux, pad, &page, pad->first_delta); /* increment the page number counter */ pad->pageno++; /* mark other pages as delta */ diff --git a/ext/ogg/gstoggstream.c b/ext/ogg/gstoggstream.c index caa986513e..3ef2fd00f5 100644 --- a/ext/ogg/gstoggstream.c +++ b/ext/ogg/gstoggstream.c @@ -501,22 +501,16 @@ setup_dirac_mapper (GstOggStream * pad, ogg_packet * packet) static gboolean is_keyframe_dirac (GstOggStream * pad, gint64 granulepos) { - gint64 pt; int dist_h; int dist_l; int dist; - int delay; - gint64 dt; if (granulepos == -1) return -1; - pt = ((granulepos >> 22) + (granulepos & OGG_DIRAC_GRANULE_LOW_MASK)) >> 9; dist_h = (granulepos >> 22) & 0xff; dist_l = granulepos & 0xff; dist = (dist_h << 8) | dist_l; - delay = (granulepos >> 9) & 0x1fff; - dt = pt - delay; return (dist == 0); } @@ -525,16 +519,10 @@ static gint64 granulepos_to_granule_dirac (GstOggStream * pad, gint64 gp) { gint64 pt; - int dist_h; - int dist_l; - int dist; int delay; gint64 dt; pt = ((gp >> 22) + (gp & OGG_DIRAC_GRANULE_LOW_MASK)) >> 9; - dist_h = (gp >> 22) & 0xff; - dist_l = gp & 0xff; - dist = (dist_h << 8) | dist_l; delay = (gp >> 9) & 0x1fff; dt = pt - delay; From 05dce4e2ac06aab55296a931c43bee079a3acf5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 14 Apr 2011 00:24:26 +0100 Subject: [PATCH 13/21] tests: fix unused-but-set-variable warnings with gcc 4.6 https://bugzilla.gnome.org/show_bug.cgi?id=647294 --- tests/examples/encoding/gstcapslist.c | 5 ++--- tests/examples/gio/giosrc-mounting.c | 1 + tests/examples/playrec/playrec.c | 1 + tests/examples/seek/jsseek.c | 6 ++++++ tests/examples/seek/seek.c | 4 ++++ 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/examples/encoding/gstcapslist.c b/tests/examples/encoding/gstcapslist.c index 4908e438c5..aed5821a31 100644 --- a/tests/examples/encoding/gstcapslist.c +++ b/tests/examples/encoding/gstcapslist.c @@ -27,7 +27,7 @@ static gboolean remove_range_foreach (GQuark field_id, const GValue * value, GstStructure * st) { GType ftype = G_VALUE_TYPE (value); - const gchar *fname; + /* const gchar *fname; */ if (ftype == GST_TYPE_INT_RANGE || ftype == GST_TYPE_DOUBLE_RANGE || ftype == GST_TYPE_FRACTION_RANGE) { @@ -35,8 +35,7 @@ remove_range_foreach (GQuark field_id, const GValue * value, GstStructure * st) return FALSE; } - fname = g_quark_to_string (field_id); - + /* fname = g_quark_to_string (field_id); */ /* if (strstr (fname, "framerate") || strstr (fname, "pixel-aspect-ratio") || */ /* strstr (fname, "rate")) { */ /* gst_structure_remove_field (st, g_quark_to_string (field_id)); */ diff --git a/tests/examples/gio/giosrc-mounting.c b/tests/examples/gio/giosrc-mounting.c index 8ca4a3cb57..0a8e202a2b 100644 --- a/tests/examples/gio/giosrc-mounting.c +++ b/tests/examples/gio/giosrc-mounting.c @@ -119,6 +119,7 @@ main (int argc, char *argv[]) gtk_main (); + g_source_remove (watch_id); gst_element_set_state (pipeline, GST_STATE_NULL); gst_object_unref (pipeline); diff --git a/tests/examples/playrec/playrec.c b/tests/examples/playrec/playrec.c index b1c1a628ba..352f65a947 100644 --- a/tests/examples/playrec/playrec.c +++ b/tests/examples/playrec/playrec.c @@ -156,6 +156,7 @@ main (int argc, char *argv[]) g_main_loop_run (loop); + g_source_remove (watch_id); gst_element_set_state (pipeline, GST_STATE_NULL); gst_object_unref (pipeline); diff --git a/tests/examples/seek/jsseek.c b/tests/examples/seek/jsseek.c index d12840baaf..ec74cc8727 100644 --- a/tests/examples/seek/jsseek.c +++ b/tests/examples/seek/jsseek.c @@ -2112,6 +2112,10 @@ step_cb (GtkButton * button, gpointer data) event = gst_event_new_step (format, amount, rate, flush, FALSE); res = send_event (event); + + if (!res) { + g_print ("Sending step event failed\n"); + } } static void @@ -2651,6 +2655,8 @@ read_joystick (GIOChannel * source, GIOCondition condition, gpointer user_data) g_print ("error reading joystick, read %u bytes of %u\n", (guint) bytes_read, (guint) sizeof (struct js_event)); return TRUE; + } else if (result != G_IO_STATUS_NORMAL) { + g_print ("reading from joystick returned status %d", result); } switch (js->type & ~JS_EVENT_INIT) { diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index b82a851f1c..8bf0818984 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -2102,6 +2102,10 @@ step_cb (GtkButton * button, gpointer data) event = gst_event_new_step (format, amount, rate, flush, FALSE); res = send_event (event); + + if (!res) { + g_print ("Sending step event failed\n"); + } } static void From 4d4aade47b44efd4f721e2caec9cdb389c81f66b Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Wed, 13 Apr 2011 23:13:59 -0300 Subject: [PATCH 14/21] tag: Adds GST_TAG_CAPTURING_EXPOSURE_COMPENSATION Adds a new tag for indicating the used exposure compensation level in EV used when capturing an image. API: GST_TAG_CAPTURING_EXPOSURE_COMPENSATION --- gst-libs/gst/tag/tag.h | 9 +++++++++ gst-libs/gst/tag/tags.c | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/gst-libs/gst/tag/tag.h b/gst-libs/gst/tag/tag.h index 472110b2ab..e9877ed853 100644 --- a/gst-libs/gst/tag/tag.h +++ b/gst-libs/gst/tag/tag.h @@ -202,6 +202,15 @@ G_BEGIN_DECLS */ #define GST_TAG_CAPTURING_EXPOSURE_MODE "capturing-exposure-mode" +/** + * GST_TAG_CAPTURING_EXPOSURE_COMPENSATION: + * + * Exposure compensation using when capturing an image in EV. (double) + * + * Since: 0.10.33 + */ +#define GST_TAG_CAPTURING_EXPOSURE_COMPENSATION "capturing-exposure-compensation" + /** * GST_TAG_CAPTURING_SCENE_CAPTURE_TYPE: * diff --git a/gst-libs/gst/tag/tags.c b/gst-libs/gst/tag/tags.c index 9521821117..a8e867c0e0 100644 --- a/gst-libs/gst/tag/tags.c +++ b/gst-libs/gst/tag/tags.c @@ -133,6 +133,10 @@ gst_tag_register_tags_internal (gpointer unused) G_TYPE_STRING, _("capturing exposure mode"), _("The exposure mode used when capturing an image"), NULL); + gst_tag_register (GST_TAG_CAPTURING_EXPOSURE_COMPENSATION, GST_TAG_FLAG_META, + G_TYPE_DOUBLE, _("capturing exposure compensation"), + _("The exposure compensation used when capturing an image"), NULL); + gst_tag_register (GST_TAG_CAPTURING_SCENE_CAPTURE_TYPE, GST_TAG_FLAG_META, G_TYPE_STRING, _("capturing scene capture type"), _("The scene capture mode used when capturing an image"), NULL); From dae1c37dfeaf843b250054376e67dce2783bdcc7 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Wed, 13 Apr 2011 23:16:02 -0300 Subject: [PATCH 15/21] tag: exif: Adds mapping for GST_TAG_CAPTURING_EXPOSURE_COMPENSATION Adds mapping for GST_TAG_CAPTURING_EXPOSURE_COMPENSATION for exif library. Includes unit tests. --- gst-libs/gst/tag/gstexiftag.c | 45 +++++++++++++++++++++++++++++++++++ tests/check/libs/tag.c | 10 ++++++++ 2 files changed, 55 insertions(+) diff --git a/gst-libs/gst/tag/gstexiftag.c b/gst-libs/gst/tag/gstexiftag.c index 360b4669f0..9f2d76e1bf 100644 --- a/gst-libs/gst/tag/gstexiftag.c +++ b/gst-libs/gst/tag/gstexiftag.c @@ -301,6 +301,7 @@ EXIF_DESERIALIZATION_FUNC (add_to_pending_tags); #define EXIF_TAG_DATE_TIME_DIGITIZED 0x9004 #define EXIF_TAG_SHUTTER_SPEED_VALUE 0x9201 #define EXIF_TAG_APERTURE_VALUE 0x9202 +#define EXIF_TAG_EXPOSURE_BIAS 0x9204 #define EXIF_TAG_METERING_MODE 0x9207 #define EXIF_TAG_FLASH 0x9209 #define EXIF_TAG_FOCAL_LENGTH 0x920A @@ -388,6 +389,8 @@ static const GstExifTagMatch tag_map_exif[] = { {GST_TAG_CAPTURING_FOCAL_RATIO, EXIF_TAG_APERTURE_VALUE, EXIF_TYPE_RATIONAL, 0, serialize_aperture_value, deserialize_aperture_value}, + {GST_TAG_CAPTURING_EXPOSURE_COMPENSATION, EXIF_TAG_EXPOSURE_BIAS, + EXIF_TYPE_SRATIONAL, 0, NULL, NULL}, {GST_TAG_CAPTURING_METERING_MODE, EXIF_TAG_METERING_MODE, EXIF_TYPE_SHORT, 0, serialize_metering_mode, deserialize_metering_mode}, {GST_TAG_CAPTURING_FLASH_FIRED, EXIF_TAG_FLASH, EXIF_TYPE_SHORT, 0, @@ -920,6 +923,41 @@ write_exif_rational_tag_from_taglist (GstExifWriter * writer, } } +static void +write_exif_signed_rational_tag_from_taglist (GstExifWriter * writer, + const GstTagList * taglist, const GstExifTagMatch * exiftag) +{ + const GValue *value; + gdouble num = 0; + gint tag_size = gst_tag_list_get_tag_size (taglist, exiftag->gst_tag); + + if (tag_size != 1) { + GST_WARNING ("Only the first item in the taglist will be serialized"); + return; + } + + value = gst_tag_list_get_value_index (taglist, exiftag->gst_tag, 0); + + /* do some conversion if needed */ + switch (G_VALUE_TYPE (value)) { + case G_TYPE_DOUBLE: + num = g_value_get_double (value); + gst_exif_writer_write_signed_rational_tag_from_double (writer, + exiftag->exif_tag, num); + break; + default: + if (G_VALUE_TYPE (value) == GST_TYPE_FRACTION) { + gst_exif_writer_write_signed_rational_tag (writer, exiftag->exif_tag, + gst_value_get_fraction_numerator (value), + gst_value_get_fraction_denominator (value)); + } else { + GST_WARNING ("Conversion from %s to signed rational not supported", + G_VALUE_TYPE_NAME (value)); + } + break; + } +} + static void write_exif_integer_tag_from_taglist (GstExifWriter * writer, const GstTagList * taglist, const GstExifTagMatch * exiftag) @@ -980,6 +1018,9 @@ write_exif_tag_from_taglist (GstExifWriter * writer, const GstTagList * taglist, case EXIF_TYPE_RATIONAL: write_exif_rational_tag_from_taglist (writer, taglist, exiftag); break; + case EXIF_TYPE_SRATIONAL: + write_exif_signed_rational_tag_from_taglist (writer, taglist, exiftag); + break; case EXIF_TYPE_LONG: case EXIF_TYPE_SHORT: write_exif_integer_tag_from_taglist (writer, taglist, exiftag); @@ -1561,6 +1602,10 @@ parse_exif_ifd (GstExifReader * exif_reader, gint buf_offset, parse_exif_rational_tag (exif_reader, tag_map[map_index].gst_tag, tagdata.count, tagdata.offset, 1, FALSE); break; + case EXIF_TYPE_SRATIONAL: + parse_exif_rational_tag (exif_reader, tag_map[map_index].gst_tag, + tagdata.count, tagdata.offset, 1, TRUE); + break; case EXIF_TYPE_UNDEFINED: parse_exif_undefined_tag (exif_reader, &tag_map[map_index], tagdata.count, tagdata.offset, tagdata.offset_as_data); diff --git a/tests/check/libs/tag.c b/tests/check/libs/tag.c index f38fcb1be4..de0a132f36 100644 --- a/tests/check/libs/tag.c +++ b/tests/check/libs/tag.c @@ -1525,6 +1525,16 @@ GST_START_TEST (test_exif_tags_serialization_deserialization) g_value_set_double (&value, 600.0); do_simple_exif_tag_serialization_deserialization (GST_TAG_IMAGE_VERTICAL_PPI, &value); + + g_value_set_double (&value, 0.0); + do_simple_exif_tag_serialization_deserialization + (GST_TAG_CAPTURING_EXPOSURE_COMPENSATION, &value); + g_value_set_double (&value, 1.0); + do_simple_exif_tag_serialization_deserialization + (GST_TAG_CAPTURING_EXPOSURE_COMPENSATION, &value); + g_value_set_double (&value, -2.5); + do_simple_exif_tag_serialization_deserialization + (GST_TAG_CAPTURING_EXPOSURE_COMPENSATION, &value); g_value_unset (&value); g_value_init (&value, G_TYPE_INT); From e57473178b196ba2e2919745985f1954020bf008 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Wed, 13 Apr 2011 23:17:14 -0300 Subject: [PATCH 16/21] tag: xmp: Adds mapping for GST_TAG_CAPTURING_EXPOSURE_COMPENSATION Adds mapping for GST_TAG_CAPTURING_EXPOSURE_COMPENSATION for xmp library. Includes unit tests. --- gst-libs/gst/tag/gstxmptag.c | 19 ++++++++++++++++++- tests/check/libs/tag.c | 12 ++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/tag/gstxmptag.c b/gst-libs/gst/tag/gstxmptag.c index 6c424baebb..ca05895010 100644 --- a/gst-libs/gst/tag/gstxmptag.c +++ b/gst-libs/gst/tag/gstxmptag.c @@ -897,6 +897,9 @@ _init_xmp_tag_map (gpointer user_data) _gst_xmp_schema_add_simple_mapping (schema, GST_TAG_GEO_LOCATION_LONGITUDE, "exif:GPSLongitude", GST_XMP_TAG_TYPE_SIMPLE, serialize_exif_longitude, deserialize_exif_longitude); + _gst_xmp_schema_add_simple_mapping (schema, + GST_TAG_CAPTURING_EXPOSURE_COMPENSATION, "exif:ExposureBiasValue", + GST_XMP_TAG_TYPE_SIMPLE, NULL, NULL); /* compound exif tags */ array = g_ptr_array_sized_new (2); @@ -984,7 +987,7 @@ static void xmp_tags_initialize () { static GOnce my_once = G_ONCE_INIT; - g_once (&my_once, (GThreadFunc)_init_xmp_tag_map, NULL); + g_once (&my_once, (GThreadFunc) _init_xmp_tag_map, NULL); } typedef struct _GstXmpNamespaceMatch GstXmpNamespaceMatch; @@ -1034,6 +1037,18 @@ read_one_tag (GstTagList * list, const gchar * tag, XmpTag * xmptag, gst_tag_list_add (list, merge_mode, tag, v, NULL); break; } + case G_TYPE_DOUBLE:{ + gdouble value = 0; + gint frac_n, frac_d; + + if (sscanf (v, "%d/%d", &frac_n, &frac_d) == 2) { + gst_util_fraction_to_double (frac_n, frac_d, &value); + gst_tag_list_add (list, merge_mode, tag, value, NULL); + } else { + GST_WARNING ("Failed to parse fraction: %s", v); + } + break; + } default: if (tag_type == GST_TYPE_DATE_TIME) { GstDateTime *datetime = NULL; @@ -1461,6 +1476,8 @@ gst_value_serialize_xmp (const GValue * value) return g_strdup_printf ("%d", g_value_get_int (value)); case G_TYPE_UINT: return g_strdup_printf ("%u", g_value_get_uint (value)); + case G_TYPE_DOUBLE: + return double_to_fraction_string (g_value_get_double (value)); default: break; } diff --git a/tests/check/libs/tag.c b/tests/check/libs/tag.c index de0a132f36..af6f726fd2 100644 --- a/tests/check/libs/tag.c +++ b/tests/check/libs/tag.c @@ -945,6 +945,8 @@ GST_START_TEST (test_xmp_tags_serialization_deserialization) GDate *date; GstDateTime *datetime; + gst_tag_register_musicbrainz_tags (); + g_value_init (&value, G_TYPE_STRING); g_value_set_static_string (&value, "my string"); do_simple_xmp_tag_serialization_deserialization (GST_TAG_ARTIST, &value); @@ -1055,6 +1057,16 @@ GST_START_TEST (test_xmp_tags_serialization_deserialization) g_value_set_double (&value, 359.99); do_simple_xmp_tag_serialization_deserialization (GST_TAG_GEO_LOCATION_CAPTURE_DIRECTION, &value); + + g_value_set_double (&value, 0.0); + do_simple_xmp_tag_serialization_deserialization + (GST_TAG_CAPTURING_EXPOSURE_COMPENSATION, &value); + g_value_set_double (&value, 1.0); + do_simple_xmp_tag_serialization_deserialization + (GST_TAG_CAPTURING_EXPOSURE_COMPENSATION, &value); + g_value_set_double (&value, -2.5); + do_simple_xmp_tag_serialization_deserialization + (GST_TAG_CAPTURING_EXPOSURE_COMPENSATION, &value); g_value_unset (&value); g_value_init (&value, GST_TYPE_DATE); From 1b5a6395d23e5d047e8442e94f7ea50e2083ad36 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Wed, 13 Apr 2011 23:17:34 -0300 Subject: [PATCH 17/21] tests: tag: Fix typo --- tests/check/libs/tag.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/check/libs/tag.c b/tests/check/libs/tag.c index af6f726fd2..c963ce5375 100644 --- a/tests/check/libs/tag.c +++ b/tests/check/libs/tag.c @@ -178,7 +178,7 @@ GST_END_TEST; "%f does not match expected %f", ___d, d); \ } -GST_START_TEST (test_muscibrainz_tag_registration) +GST_START_TEST (test_musicbrainz_tag_registration) { GstTagList *list; @@ -1622,7 +1622,7 @@ tag_suite (void) TCase *tc_chain = tcase_create ("general"); suite_add_tcase (s, tc_chain); - tcase_add_test (tc_chain, test_muscibrainz_tag_registration); + tcase_add_test (tc_chain, test_musicbrainz_tag_registration); tcase_add_test (tc_chain, test_parse_extended_comment); tcase_add_test (tc_chain, test_vorbis_tags); tcase_add_test (tc_chain, test_id3_tags); From 500d14c35c656890686574e1c041fb556df17056 Mon Sep 17 00:00:00 2001 From: Sreerenj Balachandran Date: Thu, 14 Apr 2011 00:26:34 +0300 Subject: [PATCH 18/21] video: Remove the extensive checkings from switch The default case handles them already --- gst-libs/gst/video/video.c | 71 -------------------------------------- 1 file changed, 71 deletions(-) diff --git a/gst-libs/gst/video/video.c b/gst-libs/gst/video/video.c index a369387802..f680c5a3a3 100644 --- a/gst-libs/gst/video/video.c +++ b/gst-libs/gst/video/video.c @@ -1061,27 +1061,6 @@ gboolean gst_video_format_is_rgb (GstVideoFormat format) { switch (format) { - case GST_VIDEO_FORMAT_I420: - case GST_VIDEO_FORMAT_YV12: - case GST_VIDEO_FORMAT_YUY2: - case GST_VIDEO_FORMAT_YVYU: - case GST_VIDEO_FORMAT_UYVY: - case GST_VIDEO_FORMAT_AYUV: - case GST_VIDEO_FORMAT_Y41B: - case GST_VIDEO_FORMAT_Y42B: - case GST_VIDEO_FORMAT_Y444: - case GST_VIDEO_FORMAT_v210: - case GST_VIDEO_FORMAT_v216: - case GST_VIDEO_FORMAT_NV12: - case GST_VIDEO_FORMAT_NV21: - case GST_VIDEO_FORMAT_v308: - case GST_VIDEO_FORMAT_UYVP: - case GST_VIDEO_FORMAT_A420: - case GST_VIDEO_FORMAT_YUV9: - case GST_VIDEO_FORMAT_YVU9: - case GST_VIDEO_FORMAT_IYU1: - case GST_VIDEO_FORMAT_AYUV64: - return FALSE; case GST_VIDEO_FORMAT_RGBx: case GST_VIDEO_FORMAT_BGRx: case GST_VIDEO_FORMAT_xRGB: @@ -1142,24 +1121,6 @@ gst_video_format_is_yuv (GstVideoFormat format) case GST_VIDEO_FORMAT_IYU1: case GST_VIDEO_FORMAT_AYUV64: return TRUE; - case GST_VIDEO_FORMAT_RGBx: - case GST_VIDEO_FORMAT_BGRx: - case GST_VIDEO_FORMAT_xRGB: - case GST_VIDEO_FORMAT_xBGR: - case GST_VIDEO_FORMAT_RGBA: - case GST_VIDEO_FORMAT_BGRA: - case GST_VIDEO_FORMAT_ARGB: - case GST_VIDEO_FORMAT_ABGR: - case GST_VIDEO_FORMAT_RGB: - case GST_VIDEO_FORMAT_BGR: - case GST_VIDEO_FORMAT_RGB16: - case GST_VIDEO_FORMAT_BGR16: - case GST_VIDEO_FORMAT_RGB15: - case GST_VIDEO_FORMAT_BGR15: - case GST_VIDEO_FORMAT_RGB8_PALETTED: - case GST_VIDEO_FORMAT_ARGB64: - case GST_VIDEO_FORMAT_r210: - return FALSE; default: return FALSE; } @@ -1205,26 +1166,6 @@ gboolean gst_video_format_has_alpha (GstVideoFormat format) { switch (format) { - case GST_VIDEO_FORMAT_I420: - case GST_VIDEO_FORMAT_YV12: - case GST_VIDEO_FORMAT_YUY2: - case GST_VIDEO_FORMAT_YVYU: - case GST_VIDEO_FORMAT_UYVY: - case GST_VIDEO_FORMAT_Y41B: - case GST_VIDEO_FORMAT_Y42B: - case GST_VIDEO_FORMAT_Y444: - case GST_VIDEO_FORMAT_v210: - case GST_VIDEO_FORMAT_v216: - case GST_VIDEO_FORMAT_NV12: - case GST_VIDEO_FORMAT_NV21: - case GST_VIDEO_FORMAT_v308: - case GST_VIDEO_FORMAT_Y800: - case GST_VIDEO_FORMAT_Y16: - case GST_VIDEO_FORMAT_UYVP: - case GST_VIDEO_FORMAT_YUV9: - case GST_VIDEO_FORMAT_YVU9: - case GST_VIDEO_FORMAT_IYU1: - return FALSE; case GST_VIDEO_FORMAT_AYUV: case GST_VIDEO_FORMAT_RGBA: case GST_VIDEO_FORMAT_BGRA: @@ -1235,18 +1176,6 @@ gst_video_format_has_alpha (GstVideoFormat format) case GST_VIDEO_FORMAT_ARGB64: case GST_VIDEO_FORMAT_AYUV64: return TRUE; - case GST_VIDEO_FORMAT_RGBx: - case GST_VIDEO_FORMAT_BGRx: - case GST_VIDEO_FORMAT_xRGB: - case GST_VIDEO_FORMAT_xBGR: - case GST_VIDEO_FORMAT_RGB: - case GST_VIDEO_FORMAT_BGR: - case GST_VIDEO_FORMAT_RGB16: - case GST_VIDEO_FORMAT_BGR16: - case GST_VIDEO_FORMAT_RGB15: - case GST_VIDEO_FORMAT_BGR15: - case GST_VIDEO_FORMAT_r210: - return FALSE; default: return FALSE; } From 67d2f852ffe1851a1e243b6ae1e98fa789acbbfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 14 Apr 2011 12:23:10 +0200 Subject: [PATCH 19/21] encodebin: Set all elements to NULL and remove them from the bin when removing a source group --- gst/encoding/gstencodebin.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gst/encoding/gstencodebin.c b/gst/encoding/gstencodebin.c index 51b93ce9a8..4aeb09b211 100644 --- a/gst/encoding/gstencodebin.c +++ b/gst/encoding/gstencodebin.c @@ -1559,6 +1559,7 @@ stream_group_free (GstEncodeBin * ebin, StreamGroup * sgroup) /* Capsfilter - outqueue */ gst_element_set_state (sgroup->outfilter, GST_STATE_NULL); gst_element_unlink (sgroup->outfilter, sgroup->outqueue); + gst_element_set_state (sgroup->outqueue, GST_STATE_NULL); gst_bin_remove (GST_BIN (ebin), sgroup->outqueue); /* streamcombiner - parser - capsfilter */ @@ -1566,6 +1567,7 @@ stream_group_free (GstEncodeBin * ebin, StreamGroup * sgroup) gst_element_set_state (sgroup->parser, GST_STATE_NULL); gst_element_unlink (sgroup->parser, sgroup->outfilter); gst_element_unlink (sgroup->combiner, sgroup->parser); + gst_bin_remove ((GstBin *) ebin, sgroup->parser); } /* Sink Ghostpad */ @@ -1606,6 +1608,8 @@ stream_group_free (GstEncodeBin * ebin, StreamGroup * sgroup) gst_iterator_resync (it); } gst_iterator_free (it); + gst_element_set_state (sgroup->combiner, GST_STATE_NULL); + gst_bin_remove ((GstBin *) ebin, sgroup->combiner); } if (sgroup->splitter) { @@ -1616,15 +1620,23 @@ stream_group_free (GstEncodeBin * ebin, StreamGroup * sgroup) gst_iterator_resync (it); } gst_iterator_free (it); + + gst_element_set_state (sgroup->splitter, GST_STATE_NULL); + gst_bin_remove ((GstBin *) ebin, sgroup->splitter); } if (sgroup->inqueue) gst_bin_remove ((GstBin *) ebin, sgroup->inqueue); + if (sgroup->encoder) gst_bin_remove ((GstBin *) ebin, sgroup->encoder); + if (sgroup->smartencoder) gst_bin_remove ((GstBin *) ebin, sgroup->smartencoder); + if (sgroup->outfilter) + gst_bin_remove ((GstBin *) ebin, sgroup->outfilter); + g_slice_free (StreamGroup, sgroup); } @@ -1653,6 +1665,7 @@ gst_encode_bin_tear_down_profile (GstEncodeBin * ebin) /* Remove muxer if present */ if (ebin->muxer) { + gst_element_set_state (ebin->muxer, GST_STATE_NULL); gst_bin_remove (GST_BIN (ebin), ebin->muxer); ebin->muxer = NULL; } From 10e0b85a5695eda8e7d358d49e00966a09df0569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 14 Apr 2011 12:55:00 +0200 Subject: [PATCH 20/21] encodebin: Release pads after setting the state to NULL in the unit test See bug #647756. --- tests/check/elements/encodebin.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/check/elements/encodebin.c b/tests/check/elements/encodebin.c index 0d0d009486..866abc3ec2 100644 --- a/tests/check/elements/encodebin.c +++ b/tests/check/elements/encodebin.c @@ -359,15 +359,15 @@ GST_START_TEST (test_encodebin_sink_pads_multiple_dynamic) fail_unless_equals_int (gst_element_set_state (ebin, GST_STATE_PAUSED), GST_STATE_CHANGE_SUCCESS); + /* Set back to NULL */ + fail_unless_equals_int (gst_element_set_state (ebin, GST_STATE_NULL), + GST_STATE_CHANGE_SUCCESS); + gst_element_release_request_pad (GST_ELEMENT (ebin), sinkpadvorbis); gst_object_unref (sinkpadvorbis); gst_element_release_request_pad (GST_ELEMENT (ebin), sinkpadtheora); gst_object_unref (sinkpadtheora); - /* Set back to NULL */ - fail_unless_equals_int (gst_element_set_state (ebin, GST_STATE_NULL), - GST_STATE_CHANGE_SUCCESS); - gst_object_unref (ebin); }; @@ -604,13 +604,13 @@ GST_START_TEST (test_encodebin_render_audio_dynamic) } } - gst_element_release_request_pad (GST_ELEMENT (ebin), sinkpad); - gst_object_unref (sinkpad); - /* Set back to NULL */ fail_unless_equals_int (gst_element_set_state (pipeline, GST_STATE_NULL), GST_STATE_CHANGE_SUCCESS); + gst_element_release_request_pad (GST_ELEMENT (ebin), sinkpad); + gst_object_unref (sinkpad); + gst_object_unref (bus); gst_object_unref (pipeline); @@ -745,15 +745,15 @@ GST_START_TEST (test_encodebin_render_audio_video_dynamic) } } + /* Set back to NULL */ + fail_unless_equals_int (gst_element_set_state (pipeline, GST_STATE_NULL), + GST_STATE_CHANGE_SUCCESS); + gst_element_release_request_pad (GST_ELEMENT (ebin), sinkpad1); gst_object_unref (sinkpad1); gst_element_release_request_pad (GST_ELEMENT (ebin), sinkpad2); gst_object_unref (sinkpad2); - /* Set back to NULL */ - fail_unless_equals_int (gst_element_set_state (pipeline, GST_STATE_NULL), - GST_STATE_CHANGE_SUCCESS); - gst_object_unref (bus); gst_object_unref (pipeline); From 86f679aaac87087cacd4db67ecb9bd8b2a999c0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 14 Apr 2011 13:15:08 +0200 Subject: [PATCH 21/21] encodebin: Unref encoding profiles after usage in the test --- tests/check/elements/encodebin.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/check/elements/encodebin.c b/tests/check/elements/encodebin.c index 866abc3ec2..77606cd3c7 100644 --- a/tests/check/elements/encodebin.c +++ b/tests/check/elements/encodebin.c @@ -867,6 +867,8 @@ GST_START_TEST (test_encodebin_reuse) _test_encodebin_reuse (prof2, prof3); gst_encoding_profile_unref (prof1); + gst_encoding_profile_unref (prof2); + gst_encoding_profile_unref (prof3); }; GST_END_TEST;