examples/gstplay/player.c: Don't iterate.

Original commit message from CVS:
* examples/gstplay/player.c: (main):
Don't iterate.
* examples/seeking/seek.c: (fixate), (make_playerbin_pipeline):
Add visualizations.
* ext/a52dec/gsta52dec.c: (gst_a52dec_push),
(gst_a52dec_handle_frame):
Set duration.
* ext/dvdnav/gst-dvd:
Add audioconvert. Fixes #161325.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get):
Explicitely case to gint64. Possible valgrind error.
* gst-libs/gst/play/play.c: (caps_set), (setup_size),
(gst_play_tick_callback), (gst_play_change_state),
(gst_play_dispose), (gst_play_init), (gst_play_class_init),
(gst_play_set_location), (gst_play_get_location),
(gst_play_seek_to_time), (gst_play_set_data_src),
(gst_play_set_video_sink), (gst_play_set_audio_sink),
(gst_play_set_visualization), (gst_play_connect_visualization),
(gst_play_get_framerate), (gst_play_get_all_by_interface),
(gst_play_new):
Use playbin. Fixes #139749 and #147744.
* gst/apetag/apedemux.c: (gst_ape_demux_parse_tags):
Add genre tag.
* gst/audioscale/gstaudioscale.c: (gst_audioscale_method_get_type),
(audioscale_get_type), (gst_audioscale_base_init),
(gst_audioscale_class_init), (gst_audioscale_expand_caps),
(gst_audioscale_getcaps), (gst_audioscale_fixate),
(gst_audioscale_link), (gst_audioscale_get_buffer),
(gst_audioscale_decrease_rate), (gst_audioscale_increase_rate),
(gst_audioscale_init), (gst_audioscale_dispose),
(gst_audioscale_chain), (gst_audioscale_set_property),
(gst_audioscale_get_property), (plugin_init):
Indent properly.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_private):
Fix LPCM.
* gst/qtdemux/qtdemux.c: (qtdemux_parse_udta),
(qtdemux_tag_add_str), (qtdemux_tag_add_num),
(qtdemux_tag_add_gnre), (qtdemux_video_caps):
Add more metadata (fixes #162656).
This commit is contained in:
Ronald S. Bultje 2005-01-05 14:56:27 +00:00
parent 17aa882fb0
commit 1c881d309f
8 changed files with 353 additions and 980 deletions

View file

@ -1,3 +1,45 @@
2005-01-05 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* examples/gstplay/player.c: (main):
Don't iterate.
* examples/seeking/seek.c: (fixate), (make_playerbin_pipeline):
Add visualizations.
* ext/a52dec/gsta52dec.c: (gst_a52dec_push),
(gst_a52dec_handle_frame):
Set duration.
* ext/dvdnav/gst-dvd:
Add audioconvert. Fixes #161325.
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_get):
Explicitely case to gint64. Possible valgrind error.
* gst-libs/gst/play/play.c: (caps_set), (setup_size),
(gst_play_tick_callback), (gst_play_change_state),
(gst_play_dispose), (gst_play_init), (gst_play_class_init),
(gst_play_set_location), (gst_play_get_location),
(gst_play_seek_to_time), (gst_play_set_data_src),
(gst_play_set_video_sink), (gst_play_set_audio_sink),
(gst_play_set_visualization), (gst_play_connect_visualization),
(gst_play_get_framerate), (gst_play_get_all_by_interface),
(gst_play_new):
Use playbin. Fixes #139749 and #147744.
* gst/apetag/apedemux.c: (gst_ape_demux_parse_tags):
Add genre tag.
* gst/audioscale/gstaudioscale.c: (gst_audioscale_method_get_type),
(audioscale_get_type), (gst_audioscale_base_init),
(gst_audioscale_class_init), (gst_audioscale_expand_caps),
(gst_audioscale_getcaps), (gst_audioscale_fixate),
(gst_audioscale_link), (gst_audioscale_get_buffer),
(gst_audioscale_decrease_rate), (gst_audioscale_increase_rate),
(gst_audioscale_init), (gst_audioscale_dispose),
(gst_audioscale_chain), (gst_audioscale_set_property),
(gst_audioscale_get_property), (plugin_init):
Indent properly.
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_private):
Fix LPCM.
* gst/qtdemux/qtdemux.c: (qtdemux_parse_udta),
(qtdemux_tag_add_str), (qtdemux_tag_add_num),
(qtdemux_tag_add_gnre), (qtdemux_video_caps):
Add more metadata (fixes #162656).
2005-01-05 Thomas Vander Stichele <thomas at apestaart dot org> 2005-01-05 Thomas Vander Stichele <thomas at apestaart dot org>
* configure.ac: * configure.ac:

View file

@ -90,13 +90,6 @@ seek_timer (GstPlay * play)
return FALSE; return FALSE;
} }
static gboolean
idle_iterate (GstPlay * play)
{
gst_bin_iterate (GST_BIN (play));
return (GST_STATE (GST_ELEMENT (play)) == GST_STATE_PLAYING);
}
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
@ -168,7 +161,6 @@ main (int argc, char *argv[])
GST_STATE_PLAYING) == GST_STATE_FAILURE) GST_STATE_PLAYING) == GST_STATE_FAILURE)
g_error ("Could not set state to PLAYING"); g_error ("Could not set state to PLAYING");
g_idle_add ((GSourceFunc) idle_iterate, play);
g_timeout_add (20000, (GSourceFunc) seek_timer, play); g_timeout_add (20000, (GSourceFunc) seek_timer, play);
g_main_loop_run (loop); g_main_loop_run (loop);

View file

@ -551,15 +551,45 @@ make_mpegnt_pipeline (const gchar * location)
return pipeline; return pipeline;
} }
static GstCaps *
fixate (GstPad * pad, const GstCaps * in_caps, gpointer data)
{
GstCaps *caps;
GstStructure *s;
if (gst_caps_get_size (in_caps) > 1)
return NULL;
/* nothing if fixed already */
s = gst_caps_get_structure (in_caps, 0);
if (gst_structure_has_field_typed (s, "width", G_TYPE_INT) &&
gst_structure_has_field_typed (s, "height", G_TYPE_INT) &&
gst_structure_has_field_typed (s, "framerate", G_TYPE_DOUBLE))
return NULL;
/* fixate */
caps = gst_caps_copy (in_caps);
s = gst_caps_get_structure (caps, 0);
gst_caps_structure_fixate_field_nearest_int (s, "width", 200);
gst_caps_structure_fixate_field_nearest_int (s, "height", 150);
gst_caps_structure_fixate_field_nearest_double (s, "framerate", 10.0);
return caps;
}
static GstElement * static GstElement *
make_playerbin_pipeline (const gchar * location) make_playerbin_pipeline (const gchar * location)
{ {
GstElement *player; GstElement *player, *vis;
player = gst_element_factory_make ("playbin", "player"); player = gst_element_factory_make ("playbin", "player");
vis = gst_element_factory_make ("synaesthesia", "vis");
g_assert (player); g_assert (player);
g_assert (vis);
g_object_set (G_OBJECT (player), "uri", location, NULL); g_signal_connect (gst_element_get_pad (vis, "src"), "fixate",
G_CALLBACK (fixate), NULL);
g_object_set (G_OBJECT (player), "uri", location, "vis-plugin", vis, NULL);
seekable_elements = g_list_prepend (seekable_elements, player); seekable_elements = g_list_prepend (seekable_elements, player);

View file

@ -259,8 +259,8 @@ gst_a52dec_channels (int flags, GstAudioChannelPosition ** _pos)
} }
static int static int
gst_a52dec_push (GstPad * srcpad, int flags, sample_t * samples, gst_a52dec_push (GstA52Dec * a52dec,
GstClockTime timestamp) GstPad * srcpad, int flags, sample_t * samples, GstClockTime timestamp)
{ {
GstBuffer *buf; GstBuffer *buf;
int chans, n, c; int chans, n, c;
@ -281,6 +281,7 @@ gst_a52dec_push (GstPad * srcpad, int flags, sample_t * samples,
} }
} }
GST_BUFFER_TIMESTAMP (buf) = timestamp; GST_BUFFER_TIMESTAMP (buf) = timestamp;
GST_BUFFER_DURATION (buf) = 256 * GST_SECOND / a52dec->sample_rate;
gst_pad_push (srcpad, GST_DATA (buf)); gst_pad_push (srcpad, GST_DATA (buf));
@ -413,7 +414,7 @@ gst_a52dec_handle_frame (GstA52Dec * a52dec, guint8 * data,
GST_WARNING ("a52_block error %d", i); GST_WARNING ("a52_block error %d", i);
} else { } else {
/* push on */ /* push on */
gst_a52dec_push (a52dec->srcpad, a52dec->using_channels, gst_a52dec_push (a52dec, a52dec->srcpad, a52dec->using_channels,
a52dec->samples, a52dec->time); a52dec->samples, a52dec->time);
} }
a52dec->time += 256 * GST_SECOND / a52dec->sample_rate; a52dec->time += 256 * GST_SECOND / a52dec->sample_rate;

View file

@ -4,4 +4,4 @@ AUDIOSINK=`gconftool-2 -g /system/gstreamer/0.8/default/audiosink`
VIDEOSINK=`gconftool-2 -g /system/gstreamer/0.8/default/videosink` VIDEOSINK=`gconftool-2 -g /system/gstreamer/0.8/default/videosink`
gst-launch dvdnavsrc ! dvddemux name=demux .current_video ! { queue max-size-buffers=10 ! mpeg2dec ! mpeg2subt name=sub ! \ gst-launch dvdnavsrc ! dvddemux name=demux .current_video ! { queue max-size-buffers=10 ! mpeg2dec ! mpeg2subt name=sub ! \
navseek ! $VIDEOSINK } demux.current_subpicture ! queue max-size-buffers=5 block-timeout=100000 ! sub.subtitle \ navseek ! $VIDEOSINK } demux.current_subpicture ! queue max-size-buffers=5 block-timeout=100000 ! sub.subtitle \
demux.current_audio ! { queue ! a52dec ! audioscale ! $AUDIOSINK } $@ demux.current_audio ! { queue ! a52dec ! audioconvert ! audioscale ! $AUDIOSINK } $@

View file

@ -981,7 +981,7 @@ dvdreadsrc_get (GstPad * pad)
} }
return GST_DATA (gst_event_new_discontinuous (FALSE, return GST_DATA (gst_event_new_discontinuous (FALSE,
GST_FORMAT_BYTES, priv->cur_pack * DVD_VIDEO_LB_LEN, GST_FORMAT_BYTES, (gint64) (priv->cur_pack * DVD_VIDEO_LB_LEN),
GST_FORMAT_UNDEFINED)); GST_FORMAT_UNDEFINED));
} }

File diff suppressed because it is too large Load diff

View file

@ -802,15 +802,14 @@ gst_dvd_demux_process_private (GstMPEGDemux * mpeg_demux,
len -= len % align; len -= len % align;
if (len > 0) { if (len > 0) {
DEMUX_CLASS (dvd_demux)->send_subbuffer (mpeg_demux, outstream, DEMUX_CLASS (dvd_demux)->send_subbuffer (mpeg_demux, outstream,
buffer, GST_CLOCK_TIME_NONE, headerlen + 4, first_access - 1); buffer, GST_CLOCK_TIME_NONE, off, len);
} }
off += len; off += len;
len = datalen - len; len = datalen - len;
len -= len % align; len -= len % align;
if (len > 0) { if (len > 0) {
DEMUX_CLASS (dvd_demux)->send_subbuffer (mpeg_demux, outstream, DEMUX_CLASS (dvd_demux)->send_subbuffer (mpeg_demux, outstream,
buffer, timestamp, buffer, timestamp, off, len);
headerlen + 3 + first_access, datalen - (first_access - 1));
} }
} else { } else {
off = headerlen + 4; off = headerlen + 4;
@ -818,7 +817,7 @@ gst_dvd_demux_process_private (GstMPEGDemux * mpeg_demux,
len -= len % align; len -= len % align;
if (len > 0) { if (len > 0) {
DEMUX_CLASS (dvd_demux)->send_subbuffer (mpeg_demux, outstream, DEMUX_CLASS (dvd_demux)->send_subbuffer (mpeg_demux, outstream,
buffer, timestamp, headerlen + 4, datalen); buffer, timestamp, off, len);
} }
} }
} }