mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
filter newlines out of GST_DEBUG statements to reflect new core behavior fixes to adder's caps, again
Original commit message from CVS: * filter newlines out of GST_DEBUG statements to reflect new core behavior * fixes to adder's caps, again
This commit is contained in:
parent
0cc78c5ef8
commit
1d6862cb69
22 changed files with 157 additions and 157 deletions
|
@ -232,7 +232,7 @@ gst_artsdsink_chain (GstPad *pad, GstBuffer *buf)
|
||||||
int bytes;
|
int bytes;
|
||||||
void * bufptr = GST_BUFFER_DATA (buf);
|
void * bufptr = GST_BUFFER_DATA (buf);
|
||||||
int bufsize = GST_BUFFER_SIZE (buf);
|
int bufsize = GST_BUFFER_SIZE (buf);
|
||||||
GST_DEBUG (0, "artsdsink: stream=%p data=%p size=%d\n",
|
GST_DEBUG (0, "artsdsink: stream=%p data=%p size=%d",
|
||||||
artsdsink->stream, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
|
artsdsink->stream, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
@ -359,11 +359,11 @@ gst_artsdsink_open_audio (GstArtsdsink *sink)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG (0, "artsdsink: attempting to open connection to aRtsd server\n");
|
GST_DEBUG (0, "artsdsink: attempting to open connection to aRtsd server");
|
||||||
sink->stream = arts_play_stream(sink->frequency, sink->depth,
|
sink->stream = arts_play_stream(sink->frequency, sink->depth,
|
||||||
sink->channels, connname);
|
sink->channels, connname);
|
||||||
/* FIXME: check connection */
|
/* FIXME: check connection */
|
||||||
/* GST_DEBUG (0, "artsdsink: can't open connection to aRtsd server\n"); */
|
/* GST_DEBUG (0, "artsdsink: can't open connection to aRtsd server"); */
|
||||||
|
|
||||||
GST_FLAG_SET (sink, GST_ARTSDSINK_OPEN);
|
GST_FLAG_SET (sink, GST_ARTSDSINK_OPEN);
|
||||||
sink->connected = TRUE;
|
sink->connected = TRUE;
|
||||||
|
|
|
@ -317,10 +317,10 @@ gst_afsink_open_file (GstAFSink *sink)
|
||||||
sink->is_signed = gst_caps_get_int (caps, "signed");
|
sink->is_signed = gst_caps_get_int (caps, "signed");
|
||||||
sink->endianness_data = gst_caps_get_int (caps, "endianness");
|
sink->endianness_data = gst_caps_get_int (caps, "endianness");
|
||||||
}
|
}
|
||||||
GST_DEBUG (GST_CAT_PLUGIN_INFO, "channels %d, width %d, rate %d, signed %s\n",
|
GST_DEBUG (GST_CAT_PLUGIN_INFO, "channels %d, width %d, rate %d, signed %s",
|
||||||
sink->channels, sink->width, sink->rate,
|
sink->channels, sink->width, sink->rate,
|
||||||
sink->is_signed ? "yes" : "no");
|
sink->is_signed ? "yes" : "no");
|
||||||
GST_DEBUG (GST_CAT_PLUGIN_INFO, "endianness: data %d, output %d\n",
|
GST_DEBUG (GST_CAT_PLUGIN_INFO, "endianness: data %d, output %d",
|
||||||
sink->endianness_data, sink->endianness_output);
|
sink->endianness_data, sink->endianness_output);
|
||||||
/* setup the output file */
|
/* setup the output file */
|
||||||
if (sink->is_signed)
|
if (sink->is_signed)
|
||||||
|
@ -486,7 +486,7 @@ gst_afsink_handle_event (GstPad *pad, GstEvent *event)
|
||||||
GstAFSink *afsink;
|
GstAFSink *afsink;
|
||||||
|
|
||||||
afsink = GST_AFSINK (gst_pad_get_parent (pad));
|
afsink = GST_AFSINK (gst_pad_get_parent (pad));
|
||||||
GST_DEBUG (0, "DEBUG: afsink: got event\n");
|
GST_DEBUG (0, "DEBUG: afsink: got event");
|
||||||
gst_afsink_close_file (afsink);
|
gst_afsink_close_file (afsink);
|
||||||
GST_FLAG_SET (pad, GST_PAD_EOS);
|
GST_FLAG_SET (pad, GST_PAD_EOS);
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ gst_gsmdec_class_init (GstGSMDec *klass)
|
||||||
static void
|
static void
|
||||||
gst_gsmdec_init (GstGSMDec *gsmdec)
|
gst_gsmdec_init (GstGSMDec *gsmdec)
|
||||||
{
|
{
|
||||||
GST_DEBUG (0,"gst_gsmdec_init: initializing\n");
|
GST_DEBUG (0,"gst_gsmdec_init: initializing");
|
||||||
|
|
||||||
/* create the sink and src pads */
|
/* create the sink and src pads */
|
||||||
gsmdec->sinkpad = gst_pad_new_from_template (gsmdec_sink_template, "sink");
|
gsmdec->sinkpad = gst_pad_new_from_template (gsmdec_sink_template, "sink");
|
||||||
|
|
|
@ -104,7 +104,7 @@ gst_colorspace_yuv2rgb_get_converter (GstCaps *from, GstCaps *to)
|
||||||
GstColorSpaceConverter *new;
|
GstColorSpaceConverter *new;
|
||||||
gint to_bpp;
|
gint to_bpp;
|
||||||
|
|
||||||
GST_DEBUG (0,"gst_colorspace_yuv2rgb_get_converter\n");
|
GST_DEBUG (0,"gst_colorspace_yuv2rgb_get_converter");
|
||||||
|
|
||||||
new = g_malloc (sizeof (GstColorSpaceConverter));
|
new = g_malloc (sizeof (GstColorSpaceConverter));
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ gst_colorspace_yuv2rgb_get_converter (GstCaps *from, GstCaps *to)
|
||||||
static void gst_colorspace_yuv420P_to_rgb32(GstColorSpaceConverter *space, unsigned char *src, unsigned char *dest)
|
static void gst_colorspace_yuv420P_to_rgb32(GstColorSpaceConverter *space, unsigned char *src, unsigned char *dest)
|
||||||
{
|
{
|
||||||
int size;
|
int size;
|
||||||
GST_DEBUG (0,"gst_colorspace_yuv420P_to_rgb32\n");
|
GST_DEBUG (0,"gst_colorspace_yuv420P_to_rgb32");
|
||||||
|
|
||||||
size = space->width * space->height;
|
size = space->width * space->height;
|
||||||
|
|
||||||
|
@ -197,7 +197,7 @@ static void gst_colorspace_yuv420P_to_rgb32(GstColorSpaceConverter *space, unsig
|
||||||
|
|
||||||
static void gst_colorspace_yuv420P_to_rgb24(GstColorSpaceConverter *space, unsigned char *src, unsigned char *dest) {
|
static void gst_colorspace_yuv420P_to_rgb24(GstColorSpaceConverter *space, unsigned char *src, unsigned char *dest) {
|
||||||
int size;
|
int size;
|
||||||
GST_DEBUG (0,"gst_colorspace_yuv420P_to_rgb24\n");
|
GST_DEBUG (0,"gst_colorspace_yuv420P_to_rgb24");
|
||||||
|
|
||||||
size = space->width * space->height;
|
size = space->width * space->height;
|
||||||
|
|
||||||
|
@ -213,7 +213,7 @@ static void gst_colorspace_yuv420P_to_rgb24(GstColorSpaceConverter *space, unsig
|
||||||
|
|
||||||
static void gst_colorspace_yuv420P_to_rgb16(GstColorSpaceConverter *space, unsigned char *src, unsigned char *dest) {
|
static void gst_colorspace_yuv420P_to_rgb16(GstColorSpaceConverter *space, unsigned char *src, unsigned char *dest) {
|
||||||
int size;
|
int size;
|
||||||
GST_DEBUG (0,"gst_colorspace_yuv420P_to_rgb16\n");
|
GST_DEBUG (0,"gst_colorspace_yuv420P_to_rgb16");
|
||||||
|
|
||||||
size = space->width * space->height;
|
size = space->width * space->height;
|
||||||
|
|
||||||
|
@ -230,7 +230,7 @@ static void gst_colorspace_yuv420P_to_rgb16(GstColorSpaceConverter *space, unsig
|
||||||
#ifdef HAVE_LIBMMX
|
#ifdef HAVE_LIBMMX
|
||||||
static void gst_colorspace_yuv420P_to_bgr32_mmx(GstColorSpaceConverter *space, unsigned char *src, unsigned char *dest) {
|
static void gst_colorspace_yuv420P_to_bgr32_mmx(GstColorSpaceConverter *space, unsigned char *src, unsigned char *dest) {
|
||||||
int size;
|
int size;
|
||||||
GST_DEBUG (0,"gst_colorspace_yuv420P_to_rgb32_mmx\n");
|
GST_DEBUG (0,"gst_colorspace_yuv420P_to_rgb32_mmx");
|
||||||
|
|
||||||
size = space->width * space->height;
|
size = space->width * space->height;
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ static void gst_colorspace_yuv420P_to_bgr32_mmx(GstColorSpaceConverter *space, u
|
||||||
}
|
}
|
||||||
static void gst_colorspace_yuv420P_to_bgr16_mmx(GstColorSpaceConverter *space, unsigned char *src, unsigned char *dest) {
|
static void gst_colorspace_yuv420P_to_bgr16_mmx(GstColorSpaceConverter *space, unsigned char *src, unsigned char *dest) {
|
||||||
int size;
|
int size;
|
||||||
GST_DEBUG (0,"gst_colorspace_yuv420P_to_bgr16_mmx \n");
|
GST_DEBUG (0,"gst_colorspace_yuv420P_to_bgr16_mmx ");
|
||||||
|
|
||||||
size = space->width * space->height;
|
size = space->width * space->height;
|
||||||
|
|
||||||
|
@ -256,7 +256,7 @@ static void gst_colorspace_yuv420P_to_bgr16_mmx(GstColorSpaceConverter *space, u
|
||||||
dest,
|
dest,
|
||||||
space->height,
|
space->height,
|
||||||
space->width);
|
space->width);
|
||||||
GST_DEBUG (0,"gst_colorspace_yuv420P_to_bgr16_mmx done\n");
|
GST_DEBUG (0,"gst_colorspace_yuv420P_to_bgr16_mmx done");
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -184,19 +184,19 @@ gst_ladspa_class_init (GstLADSPAClass *klass)
|
||||||
for (i=0;i<desc->PortCount;i++) {
|
for (i=0;i<desc->PortCount;i++) {
|
||||||
if (LADSPA_IS_PORT_AUDIO(desc->PortDescriptors[i]) &&
|
if (LADSPA_IS_PORT_AUDIO(desc->PortDescriptors[i]) &&
|
||||||
LADSPA_IS_PORT_INPUT(desc->PortDescriptors[i])){
|
LADSPA_IS_PORT_INPUT(desc->PortDescriptors[i])){
|
||||||
GST_DEBUG (0, "input port %d\n", i);
|
GST_DEBUG (0, "input port %d", i);
|
||||||
klass->sinkpad_portnums[sinkcount++] = i;
|
klass->sinkpad_portnums[sinkcount++] = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LADSPA_IS_PORT_AUDIO(desc->PortDescriptors[i]) &&
|
if (LADSPA_IS_PORT_AUDIO(desc->PortDescriptors[i]) &&
|
||||||
LADSPA_IS_PORT_OUTPUT(desc->PortDescriptors[i])){
|
LADSPA_IS_PORT_OUTPUT(desc->PortDescriptors[i])){
|
||||||
GST_DEBUG (0, "output port %d\n", i);
|
GST_DEBUG (0, "output port %d", i);
|
||||||
klass->srcpad_portnums[srccount++] = i;
|
klass->srcpad_portnums[srccount++] = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LADSPA_IS_PORT_CONTROL(desc->PortDescriptors[i]) &&
|
if (LADSPA_IS_PORT_CONTROL(desc->PortDescriptors[i]) &&
|
||||||
LADSPA_IS_PORT_INPUT(desc->PortDescriptors[i])){
|
LADSPA_IS_PORT_INPUT(desc->PortDescriptors[i])){
|
||||||
GST_DEBUG (0, "control port %d\n", i);
|
GST_DEBUG (0, "control port %d", i);
|
||||||
klass->control_portnums[controlcount++] = i;
|
klass->control_portnums[controlcount++] = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -450,7 +450,7 @@ gst_ladspa_connect_get (GstPad *pad, GstCaps *caps)
|
||||||
static void
|
static void
|
||||||
gst_ladspa_force_src_caps(GstLADSPA *ladspa, GstPad *pad)
|
gst_ladspa_force_src_caps(GstLADSPA *ladspa, GstPad *pad)
|
||||||
{
|
{
|
||||||
GST_DEBUG (0, "forcing caps\n");
|
GST_DEBUG (0, "forcing caps");
|
||||||
gst_pad_try_set_caps (pad, gst_caps_new (
|
gst_pad_try_set_caps (pad, gst_caps_new (
|
||||||
"ladspa_src_caps",
|
"ladspa_src_caps",
|
||||||
"audio/raw",
|
"audio/raw",
|
||||||
|
@ -528,7 +528,7 @@ gst_ladspa_set_property (GObject *object, guint prop_id, const GValue *value, GP
|
||||||
ladspa->controls[cid] = val;
|
ladspa->controls[cid] = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG (0, "set arg %s to %f\n", control_info->name, ladspa->controls[cid]);
|
GST_DEBUG (0, "set arg %s to %f", control_info->name, ladspa->controls[cid]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -556,7 +556,7 @@ gst_ladspa_get_property (GObject *object, guint prop_id, GValue *value, GParamSp
|
||||||
control_info = &(oclass->control_info[cid]);
|
control_info = &(oclass->control_info[cid]);
|
||||||
if (control_info->name == NULL) return;
|
if (control_info->name == NULL) return;
|
||||||
|
|
||||||
GST_DEBUG (0, "got arg %s as %f\n", control_info->name, ladspa->controls[cid]);
|
GST_DEBUG (0, "got arg %s as %f", control_info->name, ladspa->controls[cid]);
|
||||||
|
|
||||||
/* now see what type it is */
|
/* now see what type it is */
|
||||||
if (control_info->toggled) {
|
if (control_info->toggled) {
|
||||||
|
@ -589,7 +589,7 @@ gst_ladspa_instantiate (GstLADSPA *ladspa)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* instantiate the plugin */
|
/* instantiate the plugin */
|
||||||
GST_DEBUG (0, "instantiating the plugin\n");
|
GST_DEBUG (0, "instantiating the plugin");
|
||||||
|
|
||||||
ladspa->handle = desc->instantiate(desc,ladspa->samplerate);
|
ladspa->handle = desc->instantiate(desc,ladspa->samplerate);
|
||||||
g_return_val_if_fail (ladspa->handle != NULL, FALSE);
|
g_return_val_if_fail (ladspa->handle != NULL, FALSE);
|
||||||
|
@ -597,7 +597,7 @@ gst_ladspa_instantiate (GstLADSPA *ladspa)
|
||||||
/* walk through the ports and add all the arguments */
|
/* walk through the ports and add all the arguments */
|
||||||
for (i=0;i<oclass->numcontrols;i++) {
|
for (i=0;i<oclass->numcontrols;i++) {
|
||||||
/* connect the argument to the plugin */
|
/* connect the argument to the plugin */
|
||||||
GST_DEBUG (0, "added control port %d\n", oclass->control_portnums[i]);
|
GST_DEBUG (0, "added control port %d", oclass->control_portnums[i]);
|
||||||
desc->connect_port(ladspa->handle,
|
desc->connect_port(ladspa->handle,
|
||||||
oclass->control_portnums[i],
|
oclass->control_portnums[i],
|
||||||
&(ladspa->controls[i]));
|
&(ladspa->controls[i]));
|
||||||
|
@ -617,7 +617,7 @@ gst_ladspa_change_state (GstElement *element)
|
||||||
GstLADSPA *ladspa = (GstLADSPA*)element;
|
GstLADSPA *ladspa = (GstLADSPA*)element;
|
||||||
desc = ladspa->descriptor;
|
desc = ladspa->descriptor;
|
||||||
|
|
||||||
GST_DEBUG (0, "changing state\n");
|
GST_DEBUG (0, "changing state");
|
||||||
switch (GST_STATE_TRANSITION (element)) {
|
switch (GST_STATE_TRANSITION (element)) {
|
||||||
case GST_STATE_NULL_TO_READY:
|
case GST_STATE_NULL_TO_READY:
|
||||||
gst_ladspa_activate(ladspa);
|
gst_ladspa_activate(ladspa);
|
||||||
|
@ -645,7 +645,7 @@ gst_ladspa_activate(GstLADSPA *ladspa)
|
||||||
gst_ladspa_deactivate(ladspa);
|
gst_ladspa_deactivate(ladspa);
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG (0, "activating\n");
|
GST_DEBUG (0, "activating");
|
||||||
|
|
||||||
/* activate the plugin (function might be null) */
|
/* activate the plugin (function might be null) */
|
||||||
if (desc->activate != NULL) {
|
if (desc->activate != NULL) {
|
||||||
|
@ -661,7 +661,7 @@ gst_ladspa_deactivate(GstLADSPA *ladspa)
|
||||||
LADSPA_Descriptor *desc;
|
LADSPA_Descriptor *desc;
|
||||||
desc = ladspa->descriptor;
|
desc = ladspa->descriptor;
|
||||||
|
|
||||||
GST_DEBUG (0, "deactivating\n");
|
GST_DEBUG (0, "deactivating");
|
||||||
|
|
||||||
/* deactivate the plugin (function might be null) */
|
/* deactivate the plugin (function might be null) */
|
||||||
if (ladspa->activated && (desc->deactivate != NULL)) {
|
if (ladspa->activated && (desc->deactivate != NULL)) {
|
||||||
|
@ -703,7 +703,7 @@ gst_ladspa_loop (GstElement *element)
|
||||||
|
|
||||||
/* first get all the necessary data from the input ports */
|
/* first get all the necessary data from the input ports */
|
||||||
for (i=0;i<oclass->numsinkpads;i++){
|
for (i=0;i<oclass->numsinkpads;i++){
|
||||||
GST_DEBUG (0, "pulling %d bytes through channel %d's bytestream\n", i);
|
GST_DEBUG (0, "pulling %d bytes through channel %d's bytestream", i);
|
||||||
raw_in = gst_bytestream_peek_bytes (ladspa->bytestreams[i], ladspa->buffersize * sizeof (LADSPA_Data));
|
raw_in = gst_bytestream_peek_bytes (ladspa->bytestreams[i], ladspa->buffersize * sizeof (LADSPA_Data));
|
||||||
|
|
||||||
if (raw_in == NULL) {
|
if (raw_in == NULL) {
|
||||||
|
@ -715,7 +715,7 @@ gst_ladspa_loop (GstElement *element)
|
||||||
/* if we get an EOS event from one of our sink pads, we assume that
|
/* if we get an EOS event from one of our sink pads, we assume that
|
||||||
pad's finished handling data. delete the bytestream, free up the
|
pad's finished handling data. delete the bytestream, free up the
|
||||||
pad, and free up the memory associated with the input channel. */
|
pad, and free up the memory associated with the input channel. */
|
||||||
GST_DEBUG (0, "got an EOS event on sinkpad %d\n", i);
|
GST_DEBUG (0, "got an EOS event on sinkpad %d", i);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we need to create some zeroed out data to feed to this port of the
|
/* we need to create some zeroed out data to feed to this port of the
|
||||||
|
@ -761,7 +761,7 @@ gst_ladspa_loop (GstElement *element)
|
||||||
desc->connect_port (ladspa->handle, oclass->sinkpad_portnums[i], NULL);
|
desc->connect_port (ladspa->handle, oclass->sinkpad_portnums[i], NULL);
|
||||||
}
|
}
|
||||||
for (i=0;i<oclass->numsrcpads;i++) {
|
for (i=0;i<oclass->numsrcpads;i++) {
|
||||||
GST_DEBUG (0, "pushing buffer (%p) on src pad %d\n", buffers_out[i], i);
|
GST_DEBUG (0, "pushing buffer (%p) on src pad %d", buffers_out[i], i);
|
||||||
gst_pad_push (ladspa->srcpads[i], buffers_out[i]);
|
gst_pad_push (ladspa->srcpads[i], buffers_out[i]);
|
||||||
buffers_out[i] = NULL;
|
buffers_out[i] = NULL;
|
||||||
desc->connect_port (ladspa->handle, oclass->srcpad_portnums[i], NULL);
|
desc->connect_port (ladspa->handle, oclass->srcpad_portnums[i], NULL);
|
||||||
|
|
|
@ -341,7 +341,7 @@ gst_sdlvideosink_create (GstSDLVideoSink *sdlvideosink, gboolean showlogo)
|
||||||
else
|
else
|
||||||
SDL_DisplayYUVOverlay(sdlvideosink->yuv_overlay, &(sdlvideosink->rect));
|
SDL_DisplayYUVOverlay(sdlvideosink->yuv_overlay, &(sdlvideosink->rect));
|
||||||
|
|
||||||
GST_DEBUG (0, "sdlvideosink: setting %08lx (%4.4s)\n", sdlvideosink->format, (gchar*)&print_format);
|
GST_DEBUG (0, "sdlvideosink: setting %08lx (%4.4s)", sdlvideosink->format, (gchar*)&print_format);
|
||||||
|
|
||||||
/* TODO: is this the width of the input image stream or of the widget? */
|
/* TODO: is this the width of the input image stream or of the widget? */
|
||||||
g_signal_emit (G_OBJECT (sdlvideosink), gst_sdlvideosink_signals[SIGNAL_HAVE_SIZE], 0,
|
g_signal_emit (G_OBJECT (sdlvideosink), gst_sdlvideosink_signals[SIGNAL_HAVE_SIZE], 0,
|
||||||
|
@ -404,7 +404,7 @@ gst_sdlvideosink_chain (GstPad *pad, GstBuffer *buf)
|
||||||
|
|
||||||
sdlvideosink = GST_SDLVIDEOSINK (gst_pad_get_parent (pad));
|
sdlvideosink = GST_SDLVIDEOSINK (gst_pad_get_parent (pad));
|
||||||
|
|
||||||
GST_DEBUG (0,"videosink: clock wait: %llu\n", GST_BUFFER_TIMESTAMP(buf));
|
GST_DEBUG (0,"videosink: clock wait: %llu", GST_BUFFER_TIMESTAMP(buf));
|
||||||
|
|
||||||
while (SDL_PollEvent(&event))
|
while (SDL_PollEvent(&event))
|
||||||
{
|
{
|
||||||
|
|
|
@ -398,7 +398,7 @@ gst_icecastsend_change_state (GstElement *element)
|
||||||
|
|
||||||
icecastsend = GST_ICECASTSEND(element);
|
icecastsend = GST_ICECASTSEND(element);
|
||||||
|
|
||||||
GST_DEBUG (0,"state pending %d\n", GST_STATE_PENDING (element));
|
GST_DEBUG (0,"state pending %d", GST_STATE_PENDING (element));
|
||||||
|
|
||||||
/* if going down into NULL state, close the file if it's open */
|
/* if going down into NULL state, close the file if it's open */
|
||||||
switch (GST_STATE_TRANSITION (element)) {
|
switch (GST_STATE_TRANSITION (element)) {
|
||||||
|
|
|
@ -124,12 +124,12 @@ gst_smoothwave_init (GstSmoothWave *smoothwave)
|
||||||
/* gtk_widget_set_default_colormap (gdk_rgb_get_cmap()); */
|
/* gtk_widget_set_default_colormap (gdk_rgb_get_cmap()); */
|
||||||
/* gtk_widget_set_default_visual (gdk_rgb_get_visual()); */
|
/* gtk_widget_set_default_visual (gdk_rgb_get_visual()); */
|
||||||
|
|
||||||
/* GST_DEBUG (0,"creating palette\n"); */
|
/* GST_DEBUG (0,"creating palette"); */
|
||||||
for (i=0;i<256;i++)
|
for (i=0;i<256;i++)
|
||||||
palette[i] = (i << 16) || (i << 8);
|
palette[i] = (i << 16) || (i << 8);
|
||||||
/* GST_DEBUG (0,"creating cmap\n"); */
|
/* GST_DEBUG (0,"creating cmap"); */
|
||||||
smoothwave->cmap = gdk_rgb_cmap_new(palette,256);
|
smoothwave->cmap = gdk_rgb_cmap_new(palette,256);
|
||||||
/* GST_DEBUG (0,"created cmap\n"); */
|
/* GST_DEBUG (0,"created cmap"); */
|
||||||
/* gtk_widget_set_default_colormap (smoothwave->cmap); */
|
/* gtk_widget_set_default_colormap (smoothwave->cmap); */
|
||||||
|
|
||||||
smoothwave->image = gtk_drawing_area_new();
|
smoothwave->image = gtk_drawing_area_new();
|
||||||
|
@ -175,7 +175,7 @@ gst_smoothwave_chain (GstPad *pad, GstBuffer *buf)
|
||||||
|
|
||||||
qheight = smoothwave->height/4;
|
qheight = smoothwave->height/4;
|
||||||
|
|
||||||
/* GST_DEBUG (0,"traversing %d\n",smoothwave->width); */
|
/* GST_DEBUG (0,"traversing %d",smoothwave->width); */
|
||||||
for (i=0;i<MAX(smoothwave->width,samplecount);i++) {
|
for (i=0;i<MAX(smoothwave->width,samplecount);i++) {
|
||||||
gint16 y1 = (gint32)(samples[i*2] * qheight) / 32768 +
|
gint16 y1 = (gint32)(samples[i*2] * qheight) / 32768 +
|
||||||
qheight;
|
qheight;
|
||||||
|
@ -194,8 +194,8 @@ gst_smoothwave_chain (GstPad *pad, GstBuffer *buf)
|
||||||
ptr++;
|
ptr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GST_DEBUG (0,"drawing\n"); */
|
/* GST_DEBUG (0,"drawing"); */
|
||||||
/* GST_DEBUG (0,"gdk_draw_indexed_image(%p,%p,%d,%d,%d,%d,%s,%p,%d,%p);\n",
|
/* GST_DEBUG (0,"gdk_draw_indexed_image(%p,%p,%d,%d,%d,%d,%s,%p,%d,%p);",
|
||||||
smoothwave->image->window,
|
smoothwave->image->window,
|
||||||
smoothwave->image->style->fg_gc[GTK_STATE_NORMAL],
|
smoothwave->image->style->fg_gc[GTK_STATE_NORMAL],
|
||||||
0,0,smoothwave->width,smoothwave->height,
|
0,0,smoothwave->width,smoothwave->height,
|
||||||
|
|
|
@ -48,7 +48,7 @@ GstRiff *gst_riff_encoder_new(guint32 type) {
|
||||||
GstRiff *riff;
|
GstRiff *riff;
|
||||||
gst_riff_list *list;
|
gst_riff_list *list;
|
||||||
|
|
||||||
GST_DEBUG (0,"gst_riff_encoder: making %4.4s encoder\n", (char *)&type);
|
GST_DEBUG (0,"gst_riff_encoder: making %4.4s encoder", (char *)&type);
|
||||||
riff = (GstRiff *)g_malloc(sizeof(GstRiff));
|
riff = (GstRiff *)g_malloc(sizeof(GstRiff));
|
||||||
g_return_val_if_fail(riff != NULL, NULL);
|
g_return_val_if_fail(riff != NULL, NULL);
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ gint gst_riff_encoder_avih(GstRiff *riff, gst_riff_avih *head, gulong size) {
|
||||||
|
|
||||||
g_return_val_if_fail(riff->state == GST_RIFF_STATE_INITIAL, GST_RIFF_EINVAL);
|
g_return_val_if_fail(riff->state == GST_RIFF_STATE_INITIAL, GST_RIFF_EINVAL);
|
||||||
|
|
||||||
GST_DEBUG (0,"gst_riff_encoder: add avih\n");
|
GST_DEBUG (0,"gst_riff_encoder: add avih");
|
||||||
|
|
||||||
ADD_LIST(riff, 0xB8, GST_RIFF_LIST_hdrl);
|
ADD_LIST(riff, 0xB8, GST_RIFF_LIST_hdrl);
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ gint gst_riff_encoder_strh(GstRiff *riff, guint32 fcc_type, gst_riff_strh *head,
|
||||||
g_return_val_if_fail(riff->state == GST_RIFF_STATE_HASAVIH ||
|
g_return_val_if_fail(riff->state == GST_RIFF_STATE_HASAVIH ||
|
||||||
riff->state == GST_RIFF_STATE_HASSTRF, GST_RIFF_EINVAL);
|
riff->state == GST_RIFF_STATE_HASSTRF, GST_RIFF_EINVAL);
|
||||||
|
|
||||||
GST_DEBUG (0,"gst_riff_encoder: add strh type %08x (%4.4s)\n", fcc_type, (char *)&fcc_type);
|
GST_DEBUG (0,"gst_riff_encoder: add strh type %08x (%4.4s)", fcc_type, (char *)&fcc_type);
|
||||||
|
|
||||||
ADD_LIST(riff, 108, GST_RIFF_LIST_strl);
|
ADD_LIST(riff, 108, GST_RIFF_LIST_strl);
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ gint gst_riff_encoder_strf(GstRiff *riff, void *format, gulong size) {
|
||||||
|
|
||||||
g_return_val_if_fail(riff->state == GST_RIFF_STATE_HASSTRH, GST_RIFF_EINVAL);
|
g_return_val_if_fail(riff->state == GST_RIFF_STATE_HASSTRH, GST_RIFF_EINVAL);
|
||||||
|
|
||||||
GST_DEBUG (0,"gst_riff_encoder: add strf\n");
|
GST_DEBUG (0,"gst_riff_encoder: add strf");
|
||||||
|
|
||||||
ADD_CHUNK(riff, GST_RIFF_TAG_strf, size);
|
ADD_CHUNK(riff, GST_RIFF_TAG_strf, size);
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ gint gst_riff_encoder_chunk(GstRiff *riff, guint32 chunk_type, void *chunkdata,
|
||||||
riff->state = GST_RIFF_STATE_MOVI;
|
riff->state = GST_RIFF_STATE_MOVI;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG (0,"gst_riff_encoder: add chunk type %08x (%4.4s)\n", chunk_type, (char *)&chunk_type);
|
GST_DEBUG (0,"gst_riff_encoder: add chunk type %08x (%4.4s)", chunk_type, (char *)&chunk_type);
|
||||||
|
|
||||||
ADD_CHUNK(riff, chunk_type, size);
|
ADD_CHUNK(riff, chunk_type, size);
|
||||||
|
|
||||||
|
|
|
@ -56,12 +56,12 @@ gst_riff_parser_next_buffer (GstRiff *riff, GstBuffer *buf, gulong off)
|
||||||
size = GST_BUFFER_SIZE(buf);
|
size = GST_BUFFER_SIZE(buf);
|
||||||
last = off + size;
|
last = off + size;
|
||||||
|
|
||||||
GST_DEBUG (0,"gst_riff_parser: offset new buffer 0x%08lx size 0x%08x\n", off, GST_BUFFER_SIZE(buf));
|
GST_DEBUG (0,"gst_riff_parser: offset new buffer 0x%08lx size 0x%08x", off, GST_BUFFER_SIZE(buf));
|
||||||
|
|
||||||
if (riff->dataleft) {
|
if (riff->dataleft) {
|
||||||
gulong newsize;
|
gulong newsize;
|
||||||
|
|
||||||
GST_DEBUG (0,"gst_riff_parser: recovering left data\n");
|
GST_DEBUG (0,"gst_riff_parser: recovering left data");
|
||||||
newsize = riff->dataleft_size + size;
|
newsize = riff->dataleft_size + size;
|
||||||
riff->dataleft = g_realloc(riff->dataleft, newsize);
|
riff->dataleft = g_realloc(riff->dataleft, newsize);
|
||||||
memcpy(riff->dataleft+riff->dataleft_size, GST_BUFFER_DATA(buf), size);
|
memcpy(riff->dataleft+riff->dataleft_size, GST_BUFFER_DATA(buf), size);
|
||||||
|
@ -100,10 +100,10 @@ gst_riff_parser_next_buffer (GstRiff *riff, GstBuffer *buf, gulong off)
|
||||||
/* if we have an incomplete chunk from the previous buffer */
|
/* if we have an incomplete chunk from the previous buffer */
|
||||||
if (riff->incomplete_chunk) {
|
if (riff->incomplete_chunk) {
|
||||||
guint leftover;
|
guint leftover;
|
||||||
GST_DEBUG (0,"gst_riff_parser: have incomplete chunk %08x filled\n", riff->incomplete_chunk_size);
|
GST_DEBUG (0,"gst_riff_parser: have incomplete chunk %08x filled", riff->incomplete_chunk_size);
|
||||||
leftover = riff->incomplete_chunk->size - riff->incomplete_chunk_size;
|
leftover = riff->incomplete_chunk->size - riff->incomplete_chunk_size;
|
||||||
if (leftover <= size) {
|
if (leftover <= size) {
|
||||||
GST_DEBUG (0,"gst_riff_parser: we can fill it from %08x with %08x bytes = %08x\n",
|
GST_DEBUG (0,"gst_riff_parser: we can fill it from %08x with %08x bytes = %08x",
|
||||||
riff->incomplete_chunk_size, leftover,
|
riff->incomplete_chunk_size, leftover,
|
||||||
riff->incomplete_chunk_size+leftover);
|
riff->incomplete_chunk_size+leftover);
|
||||||
memcpy(riff->incomplete_chunk->data+riff->incomplete_chunk_size, GST_BUFFER_DATA(buf), leftover);
|
memcpy(riff->incomplete_chunk->data+riff->incomplete_chunk_size, GST_BUFFER_DATA(buf), leftover);
|
||||||
|
@ -116,7 +116,7 @@ gst_riff_parser_next_buffer (GstRiff *riff, GstBuffer *buf, gulong off)
|
||||||
riff->incomplete_chunk = NULL;
|
riff->incomplete_chunk = NULL;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
GST_DEBUG (0,"gst_riff_parser: we cannot fill it %08x >= %08lx\n", leftover, size);
|
GST_DEBUG (0,"gst_riff_parser: we cannot fill it %08x >= %08lx", leftover, size);
|
||||||
memcpy(riff->incomplete_chunk->data+riff->incomplete_chunk_size, GST_BUFFER_DATA(buf), size);
|
memcpy(riff->incomplete_chunk->data+riff->incomplete_chunk_size, GST_BUFFER_DATA(buf), size);
|
||||||
riff->incomplete_chunk_size += size;
|
riff->incomplete_chunk_size += size;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -125,7 +125,7 @@ gst_riff_parser_next_buffer (GstRiff *riff, GstBuffer *buf, gulong off)
|
||||||
|
|
||||||
if (riff->nextlikely & 0x01) riff->nextlikely++;
|
if (riff->nextlikely & 0x01) riff->nextlikely++;
|
||||||
|
|
||||||
GST_DEBUG (0,"gst_riff_parser: next 0x%08x last 0x%08lx offset %08lx\n",riff->nextlikely, last, off);
|
GST_DEBUG (0,"gst_riff_parser: next 0x%08x last 0x%08lx offset %08lx",riff->nextlikely, last, off);
|
||||||
/* loop while the next likely chunk header is in this buffer */
|
/* loop while the next likely chunk header is in this buffer */
|
||||||
while ((riff->nextlikely+12) <= last) {
|
while ((riff->nextlikely+12) <= last) {
|
||||||
guint32 *words = (guint32 *)((guchar *)GST_BUFFER_DATA(buf) + riff->nextlikely - off );
|
guint32 *words = (guint32 *)((guchar *)GST_BUFFER_DATA(buf) + riff->nextlikely - off );
|
||||||
|
@ -134,17 +134,17 @@ gst_riff_parser_next_buffer (GstRiff *riff, GstBuffer *buf, gulong off)
|
||||||
while (riff->chunks) {
|
while (riff->chunks) {
|
||||||
chunk = g_list_nth_data(riff->chunks, 0);
|
chunk = g_list_nth_data(riff->chunks, 0);
|
||||||
|
|
||||||
GST_DEBUG (0,"gst_riff_parser: next 0x%08x offset 0x%08lx size 0x%08x\n",riff->nextlikely,
|
GST_DEBUG (0,"gst_riff_parser: next 0x%08x offset 0x%08lx size 0x%08x",riff->nextlikely,
|
||||||
chunk->offset, chunk->size);
|
chunk->offset, chunk->size);
|
||||||
if (riff->nextlikely >= chunk->offset+chunk->size) {
|
if (riff->nextlikely >= chunk->offset+chunk->size) {
|
||||||
GST_DEBUG (0,"gst_riff_parser: found END LIST\n");
|
GST_DEBUG (0,"gst_riff_parser: found END LIST");
|
||||||
/* we have the end of the chunk on the stack, remove it */
|
/* we have the end of the chunk on the stack, remove it */
|
||||||
riff->chunks = g_list_remove(riff->chunks, chunk);
|
riff->chunks = g_list_remove(riff->chunks, chunk);
|
||||||
}
|
}
|
||||||
else break;
|
else break;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG (0,"gst_riff_parser: next likely chunk is at offset 0x%08x\n",riff->nextlikely);
|
GST_DEBUG (0,"gst_riff_parser: next likely chunk is at offset 0x%08x",riff->nextlikely);
|
||||||
|
|
||||||
chunk = (GstRiffChunk *)g_malloc(sizeof(GstRiffChunk));
|
chunk = (GstRiffChunk *)g_malloc(sizeof(GstRiffChunk));
|
||||||
g_return_val_if_fail(chunk != NULL, GST_RIFF_ENOMEM);
|
g_return_val_if_fail(chunk != NULL, GST_RIFF_ENOMEM);
|
||||||
|
@ -159,7 +159,7 @@ gst_riff_parser_next_buffer (GstRiff *riff, GstBuffer *buf, gulong off)
|
||||||
|
|
||||||
|
|
||||||
if (chunk->id == GST_RIFF_TAG_LIST) {
|
if (chunk->id == GST_RIFF_TAG_LIST) {
|
||||||
GST_DEBUG (0,"found LIST %s\n", gst_riff_id_to_fourcc(chunk->form));
|
GST_DEBUG (0,"found LIST %s", gst_riff_id_to_fourcc(chunk->form));
|
||||||
riff->nextlikely += 12;
|
riff->nextlikely += 12;
|
||||||
/* we push the list chunk on our 'stack' */
|
/* we push the list chunk on our 'stack' */
|
||||||
riff->chunks = g_list_prepend(riff->chunks,chunk);
|
riff->chunks = g_list_prepend(riff->chunks,chunk);
|
||||||
|
@ -170,7 +170,7 @@ gst_riff_parser_next_buffer (GstRiff *riff, GstBuffer *buf, gulong off)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
GST_DEBUG (0,"gst_riff_parser: chunk id offset %08x is 0x%08x '%s' and is 0x%08x long\n",
|
GST_DEBUG (0,"gst_riff_parser: chunk id offset %08x is 0x%08x '%s' and is 0x%08x long",
|
||||||
riff->nextlikely, GUINT32_FROM_LE (words[0]),
|
riff->nextlikely, GUINT32_FROM_LE (words[0]),
|
||||||
gst_riff_id_to_fourcc(GUINT32_FROM_LE (words[0])), GUINT32_FROM_LE (words[1]));
|
gst_riff_id_to_fourcc(GUINT32_FROM_LE (words[0])), GUINT32_FROM_LE (words[1]));
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ gst_riff_parser_next_buffer (GstRiff *riff, GstBuffer *buf, gulong off)
|
||||||
if (riff->nextlikely > last) {
|
if (riff->nextlikely > last) {
|
||||||
guint left = size - (riff->nextlikely - chunk->size - off);
|
guint left = size - (riff->nextlikely - chunk->size - off);
|
||||||
|
|
||||||
GST_DEBUG (0,"make incomplete buffer %08x\n", left);
|
GST_DEBUG (0,"make incomplete buffer %08x", left);
|
||||||
chunk->data = g_malloc(chunk->size);
|
chunk->data = g_malloc(chunk->size);
|
||||||
memcpy(chunk->data, (gchar *)(words+2), left);
|
memcpy(chunk->data, (gchar *)(words+2), left);
|
||||||
riff->incomplete_chunk = chunk;
|
riff->incomplete_chunk = chunk;
|
||||||
|
@ -199,7 +199,7 @@ gst_riff_parser_next_buffer (GstRiff *riff, GstBuffer *buf, gulong off)
|
||||||
}
|
}
|
||||||
if ((riff->nextlikely+12) > last && !riff->incomplete_chunk) {
|
if ((riff->nextlikely+12) > last && !riff->incomplete_chunk) {
|
||||||
guint left = last - riff->nextlikely;
|
guint left = last - riff->nextlikely;
|
||||||
GST_DEBUG (0,"gst_riff_parser: not enough data next 0x%08x last 0x%08lx %08x %08lx\n",riff->nextlikely,
|
GST_DEBUG (0,"gst_riff_parser: not enough data next 0x%08x last 0x%08lx %08x %08lx",riff->nextlikely,
|
||||||
last, left, off);
|
last, left, off);
|
||||||
|
|
||||||
riff->dataleft = g_malloc(left);
|
riff->dataleft = g_malloc(left);
|
||||||
|
|
|
@ -239,7 +239,7 @@ gst_chart_sinkconnect (GstPad *pad, GstCaps *caps)
|
||||||
chart->samplerate = gst_caps_get_int (caps, "rate");
|
chart->samplerate = gst_caps_get_int (caps, "rate");
|
||||||
chart->samples_between_frames = chart->samplerate / chart->framerate;
|
chart->samples_between_frames = chart->samplerate / chart->framerate;
|
||||||
|
|
||||||
GST_DEBUG (0, "CHART: new sink caps: rate %d\n",
|
GST_DEBUG (0, "CHART: new sink caps: rate %d",
|
||||||
chart->samplerate);
|
chart->samplerate);
|
||||||
/*gst_chart_sync_parms (chart); */
|
/*gst_chart_sync_parms (chart); */
|
||||||
/* */
|
/* */
|
||||||
|
@ -260,7 +260,7 @@ draw_chart_16bpp(guchar * output, gint width, gint height,
|
||||||
guint16 *colstart;
|
guint16 *colstart;
|
||||||
gint16 * in;
|
gint16 * in;
|
||||||
|
|
||||||
GST_DEBUG (0, "CHART: drawing frame to %p, width = %d, height = %d, src_data = %p, src_size = %d\n",
|
GST_DEBUG (0, "CHART: drawing frame to %p, width = %d, height = %d, src_data = %p, src_size = %d",
|
||||||
output, width, height, src_data, src_size);
|
output, width, height, src_data, src_size);
|
||||||
|
|
||||||
for (colstart = (guint16 *)output, in = (gint16 *)src_data, i = 0;
|
for (colstart = (guint16 *)output, in = (gint16 *)src_data, i = 0;
|
||||||
|
@ -319,14 +319,14 @@ gst_chart_chain (GstPad *pad, GstBuffer *bufin)
|
||||||
chart = GST_CHART(GST_OBJECT_PARENT (pad));
|
chart = GST_CHART(GST_OBJECT_PARENT (pad));
|
||||||
g_return_if_fail (chart != NULL);
|
g_return_if_fail (chart != NULL);
|
||||||
|
|
||||||
GST_DEBUG (0, "CHART: chainfunc called\n");
|
GST_DEBUG (0, "CHART: chainfunc called");
|
||||||
|
|
||||||
samples_in = GST_BUFFER_SIZE (bufin) / sizeof(gint16);
|
samples_in = GST_BUFFER_SIZE (bufin) / sizeof(gint16);
|
||||||
datain = (gint16 *) (GST_BUFFER_DATA (bufin));
|
datain = (gint16 *) (GST_BUFFER_DATA (bufin));
|
||||||
GST_DEBUG (0, "input buffer has %d samples\n", samples_in);
|
GST_DEBUG (0, "input buffer has %d samples", samples_in);
|
||||||
if (chart->next_time <= GST_BUFFER_TIMESTAMP (bufin)) {
|
if (chart->next_time <= GST_BUFFER_TIMESTAMP (bufin)) {
|
||||||
chart->next_time = GST_BUFFER_TIMESTAMP (bufin);
|
chart->next_time = GST_BUFFER_TIMESTAMP (bufin);
|
||||||
GST_DEBUG (0, "in: %lld\n", GST_BUFFER_TIMESTAMP (bufin));
|
GST_DEBUG (0, "in: %lld", GST_BUFFER_TIMESTAMP (bufin));
|
||||||
}
|
}
|
||||||
|
|
||||||
chart->samples_since_last_frame += samples_in;
|
chart->samples_since_last_frame += samples_in;
|
||||||
|
@ -341,7 +341,7 @@ gst_chart_chain (GstPad *pad, GstBuffer *bufin)
|
||||||
dataout = g_malloc (sizeout);
|
dataout = g_malloc (sizeout);
|
||||||
GST_BUFFER_SIZE(bufout) = sizeout;
|
GST_BUFFER_SIZE(bufout) = sizeout;
|
||||||
GST_BUFFER_DATA(bufout) = dataout;
|
GST_BUFFER_DATA(bufout) = dataout;
|
||||||
GST_DEBUG (0, "CHART: made new buffer: size %d, width %d, height %d\n",
|
GST_DEBUG (0, "CHART: made new buffer: size %d, width %d, height %d",
|
||||||
sizeout, chart->width, chart->height);
|
sizeout, chart->width, chart->height);
|
||||||
|
|
||||||
/* take data and draw to new buffer */
|
/* take data and draw to new buffer */
|
||||||
|
@ -355,7 +355,7 @@ gst_chart_chain (GstPad *pad, GstBuffer *bufin)
|
||||||
|
|
||||||
/* Check if we need to renegotiate size. */
|
/* Check if we need to renegotiate size. */
|
||||||
if (chart->first_buffer) {
|
if (chart->first_buffer) {
|
||||||
GST_DEBUG (0, "making new pad\n");
|
GST_DEBUG (0, "making new pad");
|
||||||
if (!gst_pad_try_set_caps (chart->srcpad,
|
if (!gst_pad_try_set_caps (chart->srcpad,
|
||||||
GST_CAPS_NEW (
|
GST_CAPS_NEW (
|
||||||
"chartsrc",
|
"chartsrc",
|
||||||
|
@ -377,17 +377,17 @@ gst_chart_chain (GstPad *pad, GstBuffer *bufin)
|
||||||
chart->first_buffer = FALSE;
|
chart->first_buffer = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG (0, "CHART: outputting buffer\n");
|
GST_DEBUG (0, "CHART: outputting buffer");
|
||||||
/* output buffer */
|
/* output buffer */
|
||||||
GST_BUFFER_FLAG_SET (bufout, GST_BUFFER_READONLY);
|
GST_BUFFER_FLAG_SET (bufout, GST_BUFFER_READONLY);
|
||||||
gst_pad_push (chart->srcpad, bufout);
|
gst_pad_push (chart->srcpad, bufout);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
GST_DEBUG (0, "CHART: skipping buffer\n");
|
GST_DEBUG (0, "CHART: skipping buffer");
|
||||||
gst_buffer_unref(bufin);
|
gst_buffer_unref(bufin);
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG (0, "CHART: exiting chainfunc\n");
|
GST_DEBUG (0, "CHART: exiting chainfunc");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -465,7 +465,7 @@ gst_flxdec_loop (GstElement *element)
|
||||||
g_return_if_fail (element != NULL);
|
g_return_if_fail (element != NULL);
|
||||||
g_return_if_fail (GST_IS_FLXDEC(element));
|
g_return_if_fail (GST_IS_FLXDEC(element));
|
||||||
|
|
||||||
GST_DEBUG (0, "entering loop function\n");
|
GST_DEBUG (0, "entering loop function");
|
||||||
|
|
||||||
flxdec = GST_FLXDEC(element);
|
flxdec = GST_FLXDEC(element);
|
||||||
|
|
||||||
|
|
|
@ -387,7 +387,7 @@ GstModPlug *modplug;
|
||||||
|
|
||||||
modplug = GST_MODPLUG (element);
|
modplug = GST_MODPLUG (element);
|
||||||
|
|
||||||
GST_DEBUG (0,"state pending %d\n", GST_STATE_PENDING (element));
|
GST_DEBUG (0,"state pending %d", GST_STATE_PENDING (element));
|
||||||
|
|
||||||
/* if going down into NULL state, close the file if it's open */
|
/* if going down into NULL state, close the file if it's open */
|
||||||
/* if (GST_STATE_PENDING (element) == GST_STATE_READY)
|
/* if (GST_STATE_PENDING (element) == GST_STATE_READY)
|
||||||
|
|
|
@ -126,7 +126,7 @@ void mpeg1mux_buffer_queue(Mpeg1MuxBuffer *mb, GstBuffer *buf) {
|
||||||
mb->length += GST_BUFFER_SIZE(buf);
|
mb->length += GST_BUFFER_SIZE(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG (0,"queuing buffer %lu\n", mb->length);
|
GST_DEBUG (0,"queuing buffer %lu", mb->length);
|
||||||
if (mb->buffer_type == BUFFER_TYPE_VIDEO) {
|
if (mb->buffer_type == BUFFER_TYPE_VIDEO) {
|
||||||
mpeg1mux_buffer_update_video_info(mb);
|
mpeg1mux_buffer_update_video_info(mb);
|
||||||
}
|
}
|
||||||
|
@ -140,7 +140,7 @@ gulong mpeg1mux_buffer_update_queued(Mpeg1MuxBuffer *mb, guint64 scr) {
|
||||||
Mpeg1MuxTimecode *tc;
|
Mpeg1MuxTimecode *tc;
|
||||||
gulong total_queued = 0;
|
gulong total_queued = 0;
|
||||||
|
|
||||||
GST_DEBUG (0,"queued in buffer on SCR=%llu\n", scr);
|
GST_DEBUG (0,"queued in buffer on SCR=%llu", scr);
|
||||||
queued_list = g_list_first(mb->queued_list);
|
queued_list = g_list_first(mb->queued_list);
|
||||||
|
|
||||||
while (queued_list) {
|
while (queued_list) {
|
||||||
|
@ -151,12 +151,12 @@ gulong mpeg1mux_buffer_update_queued(Mpeg1MuxBuffer *mb, guint64 scr) {
|
||||||
queued_list = g_list_first(mb->queued_list);
|
queued_list = g_list_first(mb->queued_list);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
GST_DEBUG (0,"queued in buffer %ld, %llu\n", tc->original_length, tc->DTS);
|
GST_DEBUG (0,"queued in buffer %ld, %llu", tc->original_length, tc->DTS);
|
||||||
total_queued += tc->original_length;
|
total_queued += tc->original_length;
|
||||||
queued_list = g_list_next(queued_list);
|
queued_list = g_list_next(queued_list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GST_DEBUG (0,"queued in buffer %lu\n", total_queued);
|
GST_DEBUG (0,"queued in buffer %lu", total_queued);
|
||||||
|
|
||||||
return total_queued;
|
return total_queued;
|
||||||
}
|
}
|
||||||
|
@ -167,7 +167,7 @@ void mpeg1mux_buffer_shrink(Mpeg1MuxBuffer *mb, gulong size) {
|
||||||
gulong consumed = 0;
|
gulong consumed = 0;
|
||||||
gulong count;
|
gulong count;
|
||||||
|
|
||||||
GST_DEBUG (0,"shrinking buffer %lu\n", size);
|
GST_DEBUG (0,"shrinking buffer %lu", size);
|
||||||
|
|
||||||
g_assert(mb->length >= size);
|
g_assert(mb->length >= size);
|
||||||
|
|
||||||
|
@ -188,16 +188,16 @@ void mpeg1mux_buffer_shrink(Mpeg1MuxBuffer *mb, gulong size) {
|
||||||
else {
|
else {
|
||||||
consumed += tc->length;
|
consumed += tc->length;
|
||||||
while (size >= consumed) {
|
while (size >= consumed) {
|
||||||
GST_DEBUG (0,"removing timecode: %llu %llu %lu %lu\n", tc->DTS, tc->PTS, tc->length, consumed);
|
GST_DEBUG (0,"removing timecode: %llu %llu %lu %lu", tc->DTS, tc->PTS, tc->length, consumed);
|
||||||
mb->timecode_list = g_list_remove_link(mb->timecode_list, timecode_list);
|
mb->timecode_list = g_list_remove_link(mb->timecode_list, timecode_list);
|
||||||
mb->queued_list = g_list_append(mb->queued_list, tc);
|
mb->queued_list = g_list_append(mb->queued_list, tc);
|
||||||
timecode_list = g_list_first(mb->timecode_list);
|
timecode_list = g_list_first(mb->timecode_list);
|
||||||
tc = (Mpeg1MuxTimecode *) timecode_list->data;
|
tc = (Mpeg1MuxTimecode *) timecode_list->data;
|
||||||
consumed += tc->length;
|
consumed += tc->length;
|
||||||
GST_DEBUG (0,"next timecode: %llu %llu %lu %lu\n", tc->DTS, tc->PTS, tc->length, consumed);
|
GST_DEBUG (0,"next timecode: %llu %llu %lu %lu", tc->DTS, tc->PTS, tc->length, consumed);
|
||||||
}
|
}
|
||||||
mb->new_frame = TRUE;
|
mb->new_frame = TRUE;
|
||||||
GST_DEBUG (0,"leftover frame size from %lu to %lu \n", tc->length, consumed-size);
|
GST_DEBUG (0,"leftover frame size from %lu to %lu ", tc->length, consumed-size);
|
||||||
tc->length = consumed - size;
|
tc->length = consumed - size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,7 +210,7 @@ void mpeg1mux_buffer_shrink(Mpeg1MuxBuffer *mb, gulong size) {
|
||||||
mb->info.audio.PTS = tc->PTS;
|
mb->info.audio.PTS = tc->PTS;
|
||||||
mb->next_frame_time = tc->PTS;
|
mb->next_frame_time = tc->PTS;
|
||||||
}
|
}
|
||||||
GST_DEBUG (0,"next frame time timecode: %llu %lu\n", mb->next_frame_time, tc->length);
|
GST_DEBUG (0,"next frame time timecode: %llu %lu", mb->next_frame_time, tc->length);
|
||||||
|
|
||||||
/* check buffer consistency */
|
/* check buffer consistency */
|
||||||
timecode_list = g_list_first(mb->timecode_list);
|
timecode_list = g_list_first(mb->timecode_list);
|
||||||
|
@ -238,7 +238,7 @@ static void mpeg1mux_buffer_update_video_info(Mpeg1MuxBuffer *mb) {
|
||||||
gst_getbits_t gb;
|
gst_getbits_t gb;
|
||||||
|
|
||||||
|
|
||||||
GST_DEBUG (0,"mpeg1mux::update_video_info %lu %lu\n", mb->base, mb->scan_pos);
|
GST_DEBUG (0,"mpeg1mux::update_video_info %lu %lu", mb->base, mb->scan_pos);
|
||||||
if (mb->base == 0 && mb->scan_pos == 0) {
|
if (mb->base == 0 && mb->scan_pos == 0) {
|
||||||
if ((SYNCWORD_START<<8)+*(mb->buffer+3) == SEQUENCE_HEADER) {
|
if ((SYNCWORD_START<<8)+*(mb->buffer+3) == SEQUENCE_HEADER) {
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@ static void mpeg1mux_buffer_update_video_info(Mpeg1MuxBuffer *mb) {
|
||||||
mb->info.video.secs_per_frame = 1. / picture_rates[mb->info.video.picture_rate];
|
mb->info.video.secs_per_frame = 1. / picture_rates[mb->info.video.picture_rate];
|
||||||
mb->info.video.decoding_order=0;
|
mb->info.video.decoding_order=0;
|
||||||
mb->info.video.group_order=0;
|
mb->info.video.group_order=0;
|
||||||
GST_DEBUG (0,"mpeg1mux::update_video_info: secs per frame %g\n", mb->info.video.secs_per_frame);
|
GST_DEBUG (0,"mpeg1mux::update_video_info: secs per frame %g", mb->info.video.secs_per_frame);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
g_print("mpeg1mux::update_video_info: Invalid MPEG Video header\n");
|
g_print("mpeg1mux::update_video_info: Invalid MPEG Video header\n");
|
||||||
|
@ -267,16 +267,16 @@ static void mpeg1mux_buffer_update_video_info(Mpeg1MuxBuffer *mb) {
|
||||||
while (offset < mb->length-6) {
|
while (offset < mb->length-6) {
|
||||||
if (!have_sync) {
|
if (!have_sync) {
|
||||||
guchar byte = *(data+offset);
|
guchar byte = *(data+offset);
|
||||||
/*GST_DEBUG (0,"mpeg1mux::update_video_info: found #%d at %lu\n",byte,offset); */
|
/*GST_DEBUG (0,"mpeg1mux::update_video_info: found #%d at %lu",byte,offset); */
|
||||||
offset++;
|
offset++;
|
||||||
/* if it's zero, increment the zero count */
|
/* if it's zero, increment the zero count */
|
||||||
if (byte == 0) {
|
if (byte == 0) {
|
||||||
sync_zeros++;
|
sync_zeros++;
|
||||||
/*GST_DEBUG (0,"mpeg1mux::update_video_info: found zero #%d at %lu\n",sync_zeros,offset-1); */
|
/*GST_DEBUG (0,"mpeg1mux::update_video_info: found zero #%d at %lu",sync_zeros,offset-1); */
|
||||||
}
|
}
|
||||||
/* if it's a one and we have two previous zeros, we have sync */
|
/* if it's a one and we have two previous zeros, we have sync */
|
||||||
else if ((byte == 1) && (sync_zeros >= 2)) {
|
else if ((byte == 1) && (sync_zeros >= 2)) {
|
||||||
GST_DEBUG (0,"mpeg1mux::update_video_info: synced at %lu\n",offset-1);
|
GST_DEBUG (0,"mpeg1mux::update_video_info: synced at %lu",offset-1);
|
||||||
have_sync = TRUE;
|
have_sync = TRUE;
|
||||||
sync_zeros = 0;
|
sync_zeros = 0;
|
||||||
}
|
}
|
||||||
|
@ -285,21 +285,21 @@ static void mpeg1mux_buffer_update_video_info(Mpeg1MuxBuffer *mb) {
|
||||||
/* then snag the chunk ID */
|
/* then snag the chunk ID */
|
||||||
} else if (id == 0) {
|
} else if (id == 0) {
|
||||||
id = *(data+offset);
|
id = *(data+offset);
|
||||||
GST_DEBUG (0,"mpeg1mux::update_video_info: got id 0x%02lX\n",id);
|
GST_DEBUG (0,"mpeg1mux::update_video_info: got id 0x%02lX",id);
|
||||||
id = (SYNCWORD_START<<8)+id;
|
id = (SYNCWORD_START<<8)+id;
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case SEQUENCE_HEADER:
|
case SEQUENCE_HEADER:
|
||||||
GST_DEBUG (0,"mpeg1mux::update_video_info: sequence header\n");
|
GST_DEBUG (0,"mpeg1mux::update_video_info: sequence header");
|
||||||
break;
|
break;
|
||||||
case GROUP_START:
|
case GROUP_START:
|
||||||
GST_DEBUG (0,"mpeg1mux::update_video_info: group start\n");
|
GST_DEBUG (0,"mpeg1mux::update_video_info: group start");
|
||||||
mb->info.video.group_order=0;
|
mb->info.video.group_order=0;
|
||||||
break;
|
break;
|
||||||
case PICTURE_START:
|
case PICTURE_START:
|
||||||
/* skip the first access unit */
|
/* skip the first access unit */
|
||||||
if (mb->info.video.decoding_order != 0) {
|
if (mb->info.video.decoding_order != 0) {
|
||||||
Mpeg1MuxTimecode *tc;
|
Mpeg1MuxTimecode *tc;
|
||||||
GST_DEBUG (0,"mpeg1mux::update_video_info: PTS %llu, DTS %llu, length %lu\n", mb->info.video.current_PTS,
|
GST_DEBUG (0,"mpeg1mux::update_video_info: PTS %llu, DTS %llu, length %lu", mb->info.video.current_PTS,
|
||||||
mb->info.video.current_DTS, offset - mb->current_start-3);
|
mb->info.video.current_DTS, offset - mb->current_start-3);
|
||||||
|
|
||||||
tc = (Mpeg1MuxTimecode *) g_malloc(sizeof(Mpeg1MuxTimecode));
|
tc = (Mpeg1MuxTimecode *) g_malloc(sizeof(Mpeg1MuxTimecode));
|
||||||
|
@ -321,7 +321,7 @@ static void mpeg1mux_buffer_update_video_info(Mpeg1MuxBuffer *mb) {
|
||||||
temp= (*(data+offset+1)<<8)+*(data+offset+2);
|
temp= (*(data+offset+1)<<8)+*(data+offset+2);
|
||||||
temporal_reference = (temp & 0xffc0) >> 6;
|
temporal_reference = (temp & 0xffc0) >> 6;
|
||||||
mb->info.video.current_type = (temp & 0x0038) >> 3;
|
mb->info.video.current_type = (temp & 0x0038) >> 3;
|
||||||
GST_DEBUG (0,"mpeg1mux::update_video_info: picture start temporal_ref:%d type:%s Frame\n", temporal_reference,
|
GST_DEBUG (0,"mpeg1mux::update_video_info: picture start temporal_ref:%d type:%s Frame", temporal_reference,
|
||||||
picture_types[mb->info.video.current_type-1]);
|
picture_types[mb->info.video.current_type-1]);
|
||||||
|
|
||||||
mb->info.video.current_DTS = mb->info.video.decoding_order * mb->info.video.secs_per_frame * CLOCKS;
|
mb->info.video.current_DTS = mb->info.video.decoding_order * mb->info.video.secs_per_frame * CLOCKS;
|
||||||
|
@ -335,7 +335,7 @@ static void mpeg1mux_buffer_update_video_info(Mpeg1MuxBuffer *mb) {
|
||||||
offset++;
|
offset++;
|
||||||
break;
|
break;
|
||||||
case SEQUENCE_END:
|
case SEQUENCE_END:
|
||||||
GST_DEBUG (0,"mpeg1mux::update_video_info: sequence end\n");
|
GST_DEBUG (0,"mpeg1mux::update_video_info: sequence end");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* prepare for next sync */
|
/* prepare for next sync */
|
||||||
|
@ -360,7 +360,7 @@ static void mpeg1mux_buffer_update_audio_info(Mpeg1MuxBuffer *mb) {
|
||||||
Mpeg1MuxTimecode *tc;
|
Mpeg1MuxTimecode *tc;
|
||||||
|
|
||||||
|
|
||||||
GST_DEBUG (0,"mpeg1mux::update_audio_info %lu %lu\n", mb->base, mb->scan_pos);
|
GST_DEBUG (0,"mpeg1mux::update_audio_info %lu %lu", mb->base, mb->scan_pos);
|
||||||
if (mb->base == 0 && mb->scan_pos == 0) {
|
if (mb->base == 0 && mb->scan_pos == 0) {
|
||||||
id = GULONG_FROM_BE(*((gulong *)(data)));
|
id = GULONG_FROM_BE(*((gulong *)(data)));
|
||||||
|
|
||||||
|
@ -386,7 +386,7 @@ static void mpeg1mux_buffer_update_audio_info(Mpeg1MuxBuffer *mb) {
|
||||||
}
|
}
|
||||||
mb->info.audio.framesize = bpf;
|
mb->info.audio.framesize = bpf;
|
||||||
|
|
||||||
GST_DEBUG (0,"mpeg1mux::update_audio_info: samples per second %d\n", samplerate_index);
|
GST_DEBUG (0,"mpeg1mux::update_audio_info: samples per second %d", samplerate_index);
|
||||||
|
|
||||||
gst_getbits_init(&gb, NULL, NULL);
|
gst_getbits_init(&gb, NULL, NULL);
|
||||||
gst_getbits_newbuf(&gb, data, mb->length);
|
gst_getbits_newbuf(&gb, data, mb->length);
|
||||||
|
@ -407,13 +407,13 @@ static void mpeg1mux_buffer_update_audio_info(Mpeg1MuxBuffer *mb) {
|
||||||
mb->info.audio.original_copy = gst_getbits1(&gb);
|
mb->info.audio.original_copy = gst_getbits1(&gb);
|
||||||
mb->info.audio.emphasis = gst_getbits2(&gb);
|
mb->info.audio.emphasis = gst_getbits2(&gb);
|
||||||
|
|
||||||
GST_DEBUG (0,"mpeg1mux::update_audio_info: layer %d\n", mb->info.audio.layer);
|
GST_DEBUG (0,"mpeg1mux::update_audio_info: layer %d", mb->info.audio.layer);
|
||||||
GST_DEBUG (0,"mpeg1mux::update_audio_info: bit_rate %d\n", mb->info.audio.bit_rate);
|
GST_DEBUG (0,"mpeg1mux::update_audio_info: bit_rate %d", mb->info.audio.bit_rate);
|
||||||
GST_DEBUG (0,"mpeg1mux::update_audio_info: frequency %d\n", mb->info.audio.frequency);
|
GST_DEBUG (0,"mpeg1mux::update_audio_info: frequency %d", mb->info.audio.frequency);
|
||||||
|
|
||||||
mb->info.audio.samples_per_second = (double)dfrequency [mb->info.audio.frequency];
|
mb->info.audio.samples_per_second = (double)dfrequency [mb->info.audio.frequency];
|
||||||
|
|
||||||
GST_DEBUG (0,"mpeg1mux::update_audio_info: samples per second %g\n", mb->info.audio.samples_per_second);
|
GST_DEBUG (0,"mpeg1mux::update_audio_info: samples per second %g", mb->info.audio.samples_per_second);
|
||||||
|
|
||||||
mb->info.audio.decoding_order=0;
|
mb->info.audio.decoding_order=0;
|
||||||
|
|
||||||
|
@ -425,7 +425,7 @@ static void mpeg1mux_buffer_update_audio_info(Mpeg1MuxBuffer *mb) {
|
||||||
mb->info.audio.current_PTS = mb->info.audio.decoding_order * samples [mb->info.audio.layer] /
|
mb->info.audio.current_PTS = mb->info.audio.decoding_order * samples [mb->info.audio.layer] /
|
||||||
mb->info.audio.samples_per_second * 90. + startup_delay;
|
mb->info.audio.samples_per_second * 90. + startup_delay;
|
||||||
|
|
||||||
GST_DEBUG (0,"mpeg1mux::update_audio_info: PTS %llu, length %u\n", mb->info.audio.current_PTS, mb->info.audio.framesize);
|
GST_DEBUG (0,"mpeg1mux::update_audio_info: PTS %llu, length %u", mb->info.audio.current_PTS, mb->info.audio.framesize);
|
||||||
tc->PTS = mb->info.audio.current_PTS;
|
tc->PTS = mb->info.audio.current_PTS;
|
||||||
tc->DTS = mb->info.audio.current_PTS;
|
tc->DTS = mb->info.audio.current_PTS;
|
||||||
mb->timecode_list = g_list_append(mb->timecode_list, tc);
|
mb->timecode_list = g_list_append(mb->timecode_list, tc);
|
||||||
|
@ -472,7 +472,7 @@ static void mpeg1mux_buffer_update_audio_info(Mpeg1MuxBuffer *mb) {
|
||||||
mb->info.audio.samples_per_second * 90. ;
|
mb->info.audio.samples_per_second * 90. ;
|
||||||
|
|
||||||
tc->DTS = tc->PTS = mb->info.audio.current_PTS;
|
tc->DTS = tc->PTS = mb->info.audio.current_PTS;
|
||||||
GST_DEBUG (0,"mpeg1mux::update_audio_info: PTS %llu, %llu length %lu\n", mb->info.audio.current_PTS, tc->PTS, tc->length);
|
GST_DEBUG (0,"mpeg1mux::update_audio_info: PTS %llu, %llu length %lu", mb->info.audio.current_PTS, tc->PTS, tc->length);
|
||||||
mb->timecode_list = g_list_append(mb->timecode_list, tc);
|
mb->timecode_list = g_list_append(mb->timecode_list, tc);
|
||||||
|
|
||||||
mb->info.audio.decoding_order++;
|
mb->info.audio.decoding_order++;
|
||||||
|
|
|
@ -216,7 +216,7 @@ gst_system_encode_pick_streams (GList *mta, GstMPEG1SystemEncode *system_encode)
|
||||||
{
|
{
|
||||||
guint64 lowest = ~1;
|
guint64 lowest = ~1;
|
||||||
|
|
||||||
GST_DEBUG (0, "pick_streams: %lld, %lld\n", system_encode->video_buffer->next_frame_time,
|
GST_DEBUG (0, "pick_streams: %lld, %lld", system_encode->video_buffer->next_frame_time,
|
||||||
system_encode->audio_buffer->next_frame_time);
|
system_encode->audio_buffer->next_frame_time);
|
||||||
|
|
||||||
if (system_encode->which_streams & STREAMS_VIDEO) {
|
if (system_encode->which_streams & STREAMS_VIDEO) {
|
||||||
|
@ -277,7 +277,7 @@ gst_system_encode_update_mta (GstMPEG1SystemEncode *system_encode, GList *mta, g
|
||||||
GList *streams = g_list_first(mta);
|
GList *streams = g_list_first(mta);
|
||||||
Mpeg1MuxBuffer *mb = (Mpeg1MuxBuffer *)streams->data;
|
Mpeg1MuxBuffer *mb = (Mpeg1MuxBuffer *)streams->data;
|
||||||
|
|
||||||
GST_DEBUG (0,"system_encode::multiplex: update mta\n");
|
GST_DEBUG (0,"system_encode::multiplex: update mta");
|
||||||
|
|
||||||
mpeg1mux_buffer_shrink(mb, size);
|
mpeg1mux_buffer_shrink(mb, size);
|
||||||
|
|
||||||
|
@ -314,7 +314,7 @@ gst_system_setup_multiplex (GstMPEG1SystemEncode *system_encode)
|
||||||
(double)(system_encode->packets_per_pack-1.))) / (double)(system_encode->packets_per_pack) );
|
(double)(system_encode->packets_per_pack-1.))) / (double)(system_encode->packets_per_pack) );
|
||||||
system_encode->data_rate = ceil(system_encode->dmux_rate/50.)*50;
|
system_encode->data_rate = ceil(system_encode->dmux_rate/50.)*50;
|
||||||
|
|
||||||
GST_DEBUG (0,"system_encode::multiplex: data_rate %u, video_rate: %u, audio_rate: %u\n", system_encode->data_rate,
|
GST_DEBUG (0,"system_encode::multiplex: data_rate %u, video_rate: %u, audio_rate: %u", system_encode->data_rate,
|
||||||
system_encode->video_rate, system_encode->audio_rate);
|
system_encode->video_rate, system_encode->audio_rate);
|
||||||
|
|
||||||
system_encode->video_delay = (double)system_encode->video_delay_ms*(double)(CLOCKS/1000);
|
system_encode->video_delay = (double)system_encode->video_delay_ms*(double)(CLOCKS/1000);
|
||||||
|
@ -326,7 +326,7 @@ gst_system_setup_multiplex (GstMPEG1SystemEncode *system_encode)
|
||||||
video_tc = MPEG1MUX_BUFFER_FIRST_TIMECODE(system_encode->video_buffer);
|
video_tc = MPEG1MUX_BUFFER_FIRST_TIMECODE(system_encode->video_buffer);
|
||||||
audio_tc = MPEG1MUX_BUFFER_FIRST_TIMECODE(system_encode->audio_buffer);
|
audio_tc = MPEG1MUX_BUFFER_FIRST_TIMECODE(system_encode->audio_buffer);
|
||||||
|
|
||||||
GST_DEBUG (0,"system_encode::video tc %lld, audio tc %lld:\n", video_tc->DTS, audio_tc->DTS);
|
GST_DEBUG (0,"system_encode::video tc %lld, audio tc %lld:", video_tc->DTS, audio_tc->DTS);
|
||||||
|
|
||||||
system_encode->delay = ((double)system_encode->sectors_delay +
|
system_encode->delay = ((double)system_encode->sectors_delay +
|
||||||
ceil((double)video_tc->length/(double)system_encode->min_packet_data) +
|
ceil((double)video_tc->length/(double)system_encode->min_packet_data) +
|
||||||
|
@ -340,7 +340,7 @@ gst_system_setup_multiplex (GstMPEG1SystemEncode *system_encode)
|
||||||
system_encode->video_delay = 0;
|
system_encode->video_delay = 0;
|
||||||
system_encode->delay = 0;
|
system_encode->delay = 0;
|
||||||
|
|
||||||
GST_DEBUG (0,"system_encode::multiplex: delay %g, mux_rate: %lu\n", system_encode->delay, system_encode->mux_rate);
|
GST_DEBUG (0,"system_encode::multiplex: delay %g, mux_rate: %lu", system_encode->delay, system_encode->mux_rate);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -360,7 +360,7 @@ gst_system_encode_multiplex(GstMPEG1SystemEncode *system_encode)
|
||||||
g_mutex_lock(system_encode->lock);
|
g_mutex_lock(system_encode->lock);
|
||||||
|
|
||||||
while (gst_system_encode_have_data(system_encode)) {
|
while (gst_system_encode_have_data(system_encode)) {
|
||||||
GST_DEBUG (0,"system_encode::multiplex: multiplexing\n");
|
GST_DEBUG (0,"system_encode::multiplex: multiplexing");
|
||||||
|
|
||||||
if (!system_encode->have_setup) {
|
if (!system_encode->have_setup) {
|
||||||
gst_system_setup_multiplex(system_encode);
|
gst_system_setup_multiplex(system_encode);
|
||||||
|
@ -396,7 +396,7 @@ gst_system_encode_multiplex(GstMPEG1SystemEncode *system_encode)
|
||||||
|
|
||||||
tc = MPEG1MUX_BUFFER_FIRST_TIMECODE(mb);
|
tc = MPEG1MUX_BUFFER_FIRST_TIMECODE(mb);
|
||||||
if (mb->new_frame) {
|
if (mb->new_frame) {
|
||||||
GST_DEBUG (0,"system_encode::multiplex: new frame\n");
|
GST_DEBUG (0,"system_encode::multiplex: new frame");
|
||||||
if (tc->frame_type == FRAME_TYPE_AUDIO || tc->frame_type == FRAME_TYPE_IFRAME || tc->frame_type == FRAME_TYPE_PFRAME) {
|
if (tc->frame_type == FRAME_TYPE_AUDIO || tc->frame_type == FRAME_TYPE_IFRAME || tc->frame_type == FRAME_TYPE_PFRAME) {
|
||||||
timestamps = TIMESTAMPS_PTS;
|
timestamps = TIMESTAMPS_PTS;
|
||||||
}
|
}
|
||||||
|
@ -457,7 +457,7 @@ gst_system_encode_multiplex(GstMPEG1SystemEncode *system_encode)
|
||||||
system_encode->bytes_output += GST_BUFFER_SIZE(outbuf);
|
system_encode->bytes_output += GST_BUFFER_SIZE(outbuf);
|
||||||
gst_pad_push(system_encode->srcpad,outbuf);
|
gst_pad_push(system_encode->srcpad,outbuf);
|
||||||
|
|
||||||
GST_DEBUG (0,"system_encode::multiplex: writing %02x\n", mb->stream_id);
|
GST_DEBUG (0,"system_encode::multiplex: writing %02x", mb->stream_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
gst_info("system_encode::multiplex: data left in video buffer %lu\n", MPEG1MUX_BUFFER_SPACE(system_encode->video_buffer));
|
gst_info("system_encode::multiplex: data left in video buffer %lu\n", MPEG1MUX_BUFFER_SPACE(system_encode->video_buffer));
|
||||||
|
@ -483,18 +483,18 @@ gst_system_encode_chain (GstPad *pad, GstBuffer *buf)
|
||||||
data = GST_BUFFER_DATA(buf);
|
data = GST_BUFFER_DATA(buf);
|
||||||
size = GST_BUFFER_SIZE(buf);
|
size = GST_BUFFER_SIZE(buf);
|
||||||
|
|
||||||
GST_DEBUG (0,"system_encode::chain: system_encode: have buffer of size %lu\n",size);
|
GST_DEBUG (0,"system_encode::chain: system_encode: have buffer of size %lu",size);
|
||||||
padname = GST_OBJECT_NAME (pad);
|
padname = GST_OBJECT_NAME (pad);
|
||||||
|
|
||||||
if (strncmp(padname, "audio_", 6) == 0) {
|
if (strncmp(padname, "audio_", 6) == 0) {
|
||||||
channel = atoi(&padname[6]);
|
channel = atoi(&padname[6]);
|
||||||
GST_DEBUG (0,"gst_system_encode_chain: got audio buffer in from audio channel %02d\n", channel);
|
GST_DEBUG (0,"gst_system_encode_chain: got audio buffer in from audio channel %02d", channel);
|
||||||
|
|
||||||
mpeg1mux_buffer_queue(system_encode->audio_buffer, buf);
|
mpeg1mux_buffer_queue(system_encode->audio_buffer, buf);
|
||||||
}
|
}
|
||||||
else if (strncmp(padname, "video_", 6) == 0) {
|
else if (strncmp(padname, "video_", 6) == 0) {
|
||||||
channel = atoi(&padname[6]);
|
channel = atoi(&padname[6]);
|
||||||
GST_DEBUG (0,"gst_system_encode_chain: got video buffer in from video channel %02d\n", channel);
|
GST_DEBUG (0,"gst_system_encode_chain: got video buffer in from video channel %02d", channel);
|
||||||
|
|
||||||
mpeg1mux_buffer_queue(system_encode->video_buffer, buf);
|
mpeg1mux_buffer_queue(system_encode->video_buffer, buf);
|
||||||
|
|
||||||
|
|
|
@ -207,7 +207,7 @@ mp1videoparse_find_next_gop (Mp1VideoParse *mp1videoparse, GstBuffer *buf)
|
||||||
static void
|
static void
|
||||||
gst_mp1videoparse_flush (Mp1VideoParse *mp1videoparse)
|
gst_mp1videoparse_flush (Mp1VideoParse *mp1videoparse)
|
||||||
{
|
{
|
||||||
GST_DEBUG (0,"mp1videoparse: flushing\n");
|
GST_DEBUG (0,"mp1videoparse: flushing");
|
||||||
if (mp1videoparse->partialbuf) {
|
if (mp1videoparse->partialbuf) {
|
||||||
gst_buffer_unref(mp1videoparse->partialbuf);
|
gst_buffer_unref(mp1videoparse->partialbuf);
|
||||||
mp1videoparse->partialbuf= NULL;
|
mp1videoparse->partialbuf= NULL;
|
||||||
|
@ -269,17 +269,17 @@ gst_mp1videoparse_real_chain (Mp1VideoParse *mp1videoparse, GstBuffer *buf, GstP
|
||||||
data = GST_BUFFER_DATA(mp1videoparse->partialbuf);
|
data = GST_BUFFER_DATA(mp1videoparse->partialbuf);
|
||||||
size = GST_BUFFER_SIZE(mp1videoparse->partialbuf);
|
size = GST_BUFFER_SIZE(mp1videoparse->partialbuf);
|
||||||
|
|
||||||
GST_DEBUG (0,"mp1videoparse: received buffer of %ld bytes %lld\n",size, GST_BUFFER_TIMESTAMP(buf));
|
GST_DEBUG (0,"mp1videoparse: received buffer of %ld bytes %lld",size, GST_BUFFER_TIMESTAMP(buf));
|
||||||
|
|
||||||
head = GULONG_FROM_BE(*((gulong *)data));
|
head = GULONG_FROM_BE(*((gulong *)data));
|
||||||
|
|
||||||
GST_DEBUG (0,"mp1videoparse: head is %08lx\n", head);
|
GST_DEBUG (0,"mp1videoparse: head is %08lx", head);
|
||||||
|
|
||||||
if (!mp1videoparse_valid_sync(head) || mp1videoparse->need_resync) {
|
if (!mp1videoparse_valid_sync(head) || mp1videoparse->need_resync) {
|
||||||
sync_pos = mp1videoparse_find_next_gop(mp1videoparse, mp1videoparse->partialbuf);
|
sync_pos = mp1videoparse_find_next_gop(mp1videoparse, mp1videoparse->partialbuf);
|
||||||
if (sync_pos != -1) {
|
if (sync_pos != -1) {
|
||||||
mp1videoparse->need_resync = FALSE;
|
mp1videoparse->need_resync = FALSE;
|
||||||
GST_DEBUG (0,"mp1videoparse: found new gop at %d\n", sync_pos);
|
GST_DEBUG (0,"mp1videoparse: found new gop at %d", sync_pos);
|
||||||
|
|
||||||
if (sync_pos != 0) {
|
if (sync_pos != 0) {
|
||||||
temp = gst_buffer_create_sub(mp1videoparse->partialbuf, sync_pos, size-sync_pos);
|
temp = gst_buffer_create_sub(mp1videoparse->partialbuf, sync_pos, size-sync_pos);
|
||||||
|
@ -292,7 +292,7 @@ gst_mp1videoparse_real_chain (Mp1VideoParse *mp1videoparse, GstBuffer *buf, GstP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
GST_DEBUG (0,"mp1videoparse: could not sync\n");
|
GST_DEBUG (0,"mp1videoparse: could not sync");
|
||||||
gst_buffer_unref(mp1videoparse->partialbuf);
|
gst_buffer_unref(mp1videoparse->partialbuf);
|
||||||
mp1videoparse->partialbuf = NULL;
|
mp1videoparse->partialbuf = NULL;
|
||||||
return;
|
return;
|
||||||
|
@ -306,7 +306,7 @@ gst_mp1videoparse_real_chain (Mp1VideoParse *mp1videoparse, GstBuffer *buf, GstP
|
||||||
sync_state = 0;
|
sync_state = 0;
|
||||||
have_sync = FALSE;
|
have_sync = FALSE;
|
||||||
|
|
||||||
GST_DEBUG (0,"mp1videoparse: searching sync\n");
|
GST_DEBUG (0,"mp1videoparse: searching sync");
|
||||||
|
|
||||||
while (offset < size-1) {
|
while (offset < size-1) {
|
||||||
sync_byte = *(data + offset);
|
sync_byte = *(data + offset);
|
||||||
|
@ -315,7 +315,7 @@ gst_mp1videoparse_real_chain (Mp1VideoParse *mp1videoparse, GstBuffer *buf, GstP
|
||||||
sync_state++;
|
sync_state++;
|
||||||
}
|
}
|
||||||
else if ((sync_byte == 1) && (sync_state >=2)) {
|
else if ((sync_byte == 1) && (sync_state >=2)) {
|
||||||
GST_DEBUG (0,"mp1videoparse: code 0x000001%02x\n",data[offset+1]);
|
GST_DEBUG (0,"mp1videoparse: code 0x000001%02x",data[offset+1]);
|
||||||
if (data[offset+1] == (PICTURE_START_CODE & 0xff)) {
|
if (data[offset+1] == (PICTURE_START_CODE & 0xff)) {
|
||||||
mp1videoparse->picture_in_buffer++;
|
mp1videoparse->picture_in_buffer++;
|
||||||
if (mp1videoparse->picture_in_buffer == 1) {
|
if (mp1videoparse->picture_in_buffer == 1) {
|
||||||
|
@ -327,7 +327,7 @@ gst_mp1videoparse_real_chain (Mp1VideoParse *mp1videoparse, GstBuffer *buf, GstP
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
GST_DEBUG (0,"mp1videoparse: %d in buffer\n", mp1videoparse->picture_in_buffer);
|
GST_DEBUG (0,"mp1videoparse: %d in buffer", mp1videoparse->picture_in_buffer);
|
||||||
g_assert_not_reached();
|
g_assert_not_reached();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -341,7 +341,7 @@ gst_mp1videoparse_real_chain (Mp1VideoParse *mp1videoparse, GstBuffer *buf, GstP
|
||||||
|
|
||||||
if (have_sync) {
|
if (have_sync) {
|
||||||
offset -= 2;
|
offset -= 2;
|
||||||
GST_DEBUG (0,"mp1videoparse: synced at %ld code 0x000001%02x\n",offset,data[offset+3]);
|
GST_DEBUG (0,"mp1videoparse: synced at %ld code 0x000001%02x",offset,data[offset+3]);
|
||||||
|
|
||||||
outbuf = gst_buffer_create_sub(mp1videoparse->partialbuf, 0, offset+4);
|
outbuf = gst_buffer_create_sub(mp1videoparse->partialbuf, 0, offset+4);
|
||||||
g_assert(outbuf != NULL);
|
g_assert(outbuf != NULL);
|
||||||
|
@ -352,9 +352,9 @@ gst_mp1videoparse_real_chain (Mp1VideoParse *mp1videoparse, GstBuffer *buf, GstP
|
||||||
mp1videoparse->in_flush = FALSE;
|
mp1videoparse->in_flush = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG (0,"mp1videoparse: pushing %d bytes %llu\n", GST_BUFFER_SIZE(outbuf), GST_BUFFER_TIMESTAMP(outbuf));
|
GST_DEBUG (0,"mp1videoparse: pushing %d bytes %llu", GST_BUFFER_SIZE(outbuf), GST_BUFFER_TIMESTAMP(outbuf));
|
||||||
gst_pad_push(outpad, outbuf);
|
gst_pad_push(outpad, outbuf);
|
||||||
GST_DEBUG (0,"mp1videoparse: pushing done\n");
|
GST_DEBUG (0,"mp1videoparse: pushing done");
|
||||||
mp1videoparse->picture_in_buffer = 0;
|
mp1videoparse->picture_in_buffer = 0;
|
||||||
|
|
||||||
temp = gst_buffer_create_sub(mp1videoparse->partialbuf, offset, size-offset);
|
temp = gst_buffer_create_sub(mp1videoparse->partialbuf, offset, size-offset);
|
||||||
|
@ -374,7 +374,7 @@ gst_mp1videoparse_change_state (GstElement *element)
|
||||||
g_return_val_if_fail(GST_IS_MP1VIDEOPARSE(element),GST_STATE_FAILURE);
|
g_return_val_if_fail(GST_IS_MP1VIDEOPARSE(element),GST_STATE_FAILURE);
|
||||||
|
|
||||||
mp1videoparse = GST_MP1VIDEOPARSE(element);
|
mp1videoparse = GST_MP1VIDEOPARSE(element);
|
||||||
GST_DEBUG (0,"mp1videoparse: state pending %d\n", GST_STATE_PENDING(element));
|
GST_DEBUG (0,"mp1videoparse: state pending %d", GST_STATE_PENDING(element));
|
||||||
|
|
||||||
* if going down into NULL state, clear out buffers *
|
* if going down into NULL state, clear out buffers *
|
||||||
if (GST_STATE_PENDING(element) == GST_STATE_READY) {
|
if (GST_STATE_PENDING(element) == GST_STATE_READY) {
|
||||||
|
|
|
@ -197,7 +197,7 @@ gst_mpeg2subt_parse_header (GstMpeg2Subt *mpeg2subt)
|
||||||
mpeg2subt->color[2] = yuv_color[buffer [i+2] >> 4];
|
mpeg2subt->color[2] = yuv_color[buffer [i+2] >> 4];
|
||||||
mpeg2subt->color[3] = yuv_color[buffer [i+2] & 0xf];
|
mpeg2subt->color[3] = yuv_color[buffer [i+2] & 0xf];
|
||||||
mpeg2subt->color[4] = yuv_color[0xf];
|
mpeg2subt->color[4] = yuv_color[0xf];
|
||||||
GST_DEBUG (0,"mpeg2subt: colors %d %d %d %d\n", mpeg2subt->color[0],mpeg2subt->color[1],mpeg2subt->color[2],mpeg2subt->color[3]);
|
GST_DEBUG (0,"mpeg2subt: colors %d %d %d %d", mpeg2subt->color[0],mpeg2subt->color[1],mpeg2subt->color[2],mpeg2subt->color[3]);
|
||||||
i += 3;
|
i += 3;
|
||||||
break;
|
break;
|
||||||
case 0x04: /* transparency palette */
|
case 0x04: /* transparency palette */
|
||||||
|
@ -205,7 +205,7 @@ gst_mpeg2subt_parse_header (GstMpeg2Subt *mpeg2subt)
|
||||||
mpeg2subt->trans[2] = buffer [i+1] & 0xf;
|
mpeg2subt->trans[2] = buffer [i+1] & 0xf;
|
||||||
mpeg2subt->trans[1] = buffer [i+2] >> 4;
|
mpeg2subt->trans[1] = buffer [i+2] >> 4;
|
||||||
mpeg2subt->trans[0] = buffer [i+2] & 0xf;
|
mpeg2subt->trans[0] = buffer [i+2] & 0xf;
|
||||||
GST_DEBUG (0,"mpeg2subt: transparency %d %d %d %d\n", mpeg2subt->trans[0],mpeg2subt->trans[1],mpeg2subt->trans[2],mpeg2subt->trans[3]);
|
GST_DEBUG (0,"mpeg2subt: transparency %d %d %d %d", mpeg2subt->trans[0],mpeg2subt->trans[1],mpeg2subt->trans[2],mpeg2subt->trans[3]);
|
||||||
i += 3;
|
i += 3;
|
||||||
break;
|
break;
|
||||||
case 0x05: /* image coordinates */
|
case 0x05: /* image coordinates */
|
||||||
|
@ -225,7 +225,7 @@ gst_mpeg2subt_parse_header (GstMpeg2Subt *mpeg2subt)
|
||||||
*/
|
*/
|
||||||
mpeg2subt->duration = (((buffer[i+1] << 8) + buffer[i+2]) * 25)/90;
|
mpeg2subt->duration = (((buffer[i+1] << 8) + buffer[i+2]) * 25)/90;
|
||||||
|
|
||||||
GST_DEBUG (0,"duration %d\n", mpeg2subt->duration);
|
GST_DEBUG (0,"duration %d", mpeg2subt->duration);
|
||||||
|
|
||||||
if ( (buffer[i+3] != buffer[mpeg2subt->data_size+2])
|
if ( (buffer[i+3] != buffer[mpeg2subt->data_size+2])
|
||||||
|| (buffer[i+4] != buffer[mpeg2subt->data_size+3]) )
|
|| (buffer[i+4] != buffer[mpeg2subt->data_size+3]) )
|
||||||
|
@ -279,7 +279,7 @@ gst_mpeg2subt_merge_title (GstMpeg2Subt *mpeg2subt, GstBuffer *buf)
|
||||||
offset[1] = mpeg2subt->offset[1];
|
offset[1] = mpeg2subt->offset[1];
|
||||||
#define get_nibble() get_nibble (buffer, offset, id, &aligned)
|
#define get_nibble() get_nibble (buffer, offset, id, &aligned)
|
||||||
|
|
||||||
GST_DEBUG (0,"mpeg2subt: merging subtitle\n");
|
GST_DEBUG (0,"mpeg2subt: merging subtitle");
|
||||||
|
|
||||||
while ((offset[1] < mpeg2subt->data_size + 2) && (y < height))
|
while ((offset[1] < mpeg2subt->data_size + 2) && (y < height))
|
||||||
{
|
{
|
||||||
|
@ -361,7 +361,7 @@ gst_mpeg2subt_chain_subtitle (GstPad *pad, GstBuffer *buf)
|
||||||
mpeg2subt->have_title = FALSE;
|
mpeg2subt->have_title = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG (0,"presentation time %llu\n", GST_BUFFER_TIMESTAMP(buf));
|
GST_DEBUG (0,"presentation time %llu", GST_BUFFER_TIMESTAMP(buf));
|
||||||
|
|
||||||
/* deal with partial frame from previous buffer */
|
/* deal with partial frame from previous buffer */
|
||||||
if (mpeg2subt->partialbuf) {
|
if (mpeg2subt->partialbuf) {
|
||||||
|
@ -381,7 +381,7 @@ gst_mpeg2subt_chain_subtitle (GstPad *pad, GstBuffer *buf)
|
||||||
|
|
||||||
if (mpeg2subt->packet_size == size) {
|
if (mpeg2subt->packet_size == size) {
|
||||||
|
|
||||||
GST_DEBUG (0,"mpeg2subt: subtitle packet size %d, current size %ld\n", mpeg2subt->packet_size, size);
|
GST_DEBUG (0,"mpeg2subt: subtitle packet size %d, current size %ld", mpeg2subt->packet_size, size);
|
||||||
|
|
||||||
mpeg2subt->data_size = GUINT16_FROM_BE(*(guint16 *)(data+2));
|
mpeg2subt->data_size = GUINT16_FROM_BE(*(guint16 *)(data+2));
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ mp3_typefind(GstBuffer *buf, gpointer private)
|
||||||
|
|
||||||
data = GST_BUFFER_DATA(buf);
|
data = GST_BUFFER_DATA(buf);
|
||||||
|
|
||||||
GST_DEBUG (0,"mp3typefind: typefind\n");
|
GST_DEBUG (0,"mp3typefind: typefind");
|
||||||
|
|
||||||
/* check for ID3 Tag first and forward ID3 length */
|
/* check for ID3 Tag first and forward ID3 length */
|
||||||
if (!memcmp (data, "ID3", 3))
|
if (!memcmp (data, "ID3", 3))
|
||||||
|
@ -51,11 +51,11 @@ mp3_typefind(GstBuffer *buf, gpointer private)
|
||||||
((skip & 0x007f0000) >> 2) |
|
((skip & 0x007f0000) >> 2) |
|
||||||
((skip & 0x00007f00) >> 1) |
|
((skip & 0x00007f00) >> 1) |
|
||||||
((skip & 0x0000007f) >> 0)) + 4;
|
((skip & 0x0000007f) >> 0)) + 4;
|
||||||
GST_DEBUG (0, "mp3typefind: detected ID3 Tag with %u bytes\n", skip + 6);
|
GST_DEBUG (0, "mp3typefind: detected ID3 Tag with %u bytes", skip + 6);
|
||||||
/* return if buffer is not big enough */
|
/* return if buffer is not big enough */
|
||||||
if (GST_BUFFER_SIZE (buf) < skip + 10)
|
if (GST_BUFFER_SIZE (buf) < skip + 10)
|
||||||
{
|
{
|
||||||
GST_DEBUG (0, "mp3typefind: buffer too small (%d) to go on typefinding\n", skip + 6);
|
GST_DEBUG (0, "mp3typefind: buffer too small (%d) to go on typefinding", skip + 6);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
data += skip;
|
data += skip;
|
||||||
|
|
|
@ -242,7 +242,7 @@ gst_mp3parse_chain (GstPad *pad, GstBuffer *buf)
|
||||||
|
|
||||||
mp3parse = GST_MP3PARSE (gst_pad_get_parent (pad));
|
mp3parse = GST_MP3PARSE (gst_pad_get_parent (pad));
|
||||||
|
|
||||||
GST_DEBUG (0,"mp3parse: received buffer of %d bytes\n",GST_BUFFER_SIZE(buf));
|
GST_DEBUG (0,"mp3parse: received buffer of %d bytes",GST_BUFFER_SIZE(buf));
|
||||||
|
|
||||||
last_ts = GST_BUFFER_TIMESTAMP(buf);
|
last_ts = GST_BUFFER_TIMESTAMP(buf);
|
||||||
|
|
||||||
|
@ -273,12 +273,12 @@ gst_mp3parse_chain (GstPad *pad, GstBuffer *buf)
|
||||||
while (offset < size-4) {
|
while (offset < size-4) {
|
||||||
int skipped = 0;
|
int skipped = 0;
|
||||||
|
|
||||||
GST_DEBUG (0,"mp3parse: offset %ld, size %ld \n",offset, size);
|
GST_DEBUG (0,"mp3parse: offset %ld, size %ld ",offset, size);
|
||||||
|
|
||||||
/* search for a possible start byte */
|
/* search for a possible start byte */
|
||||||
for (;((data[offset] != 0xff) && (offset < size));offset++) skipped++;
|
for (;((data[offset] != 0xff) && (offset < size));offset++) skipped++;
|
||||||
if (skipped && !mp3parse->in_flush) {
|
if (skipped && !mp3parse->in_flush) {
|
||||||
GST_DEBUG (0,"mp3parse: **** now at %ld skipped %d bytes\n",offset,skipped);
|
GST_DEBUG (0,"mp3parse: **** now at %ld skipped %d bytes",offset,skipped);
|
||||||
}
|
}
|
||||||
/* construct the header word */
|
/* construct the header word */
|
||||||
header = GULONG_FROM_BE(*((gulong *)(data+offset)));
|
header = GULONG_FROM_BE(*((gulong *)(data+offset)));
|
||||||
|
@ -305,12 +305,12 @@ gst_mp3parse_chain (GstPad *pad, GstBuffer *buf)
|
||||||
if ((size-offset)<(bpf+4)) { if (mp3parse->in_flush) break; } /* wait until we have the the entire current frame as well as the next frame header */
|
if ((size-offset)<(bpf+4)) { if (mp3parse->in_flush) break; } /* wait until we have the the entire current frame as well as the next frame header */
|
||||||
|
|
||||||
header2 = GULONG_FROM_BE(*((gulong *)(data+offset+bpf)));
|
header2 = GULONG_FROM_BE(*((gulong *)(data+offset+bpf)));
|
||||||
GST_DEBUG(0,"mp3parse: header=%08lX, header2=%08lX, bpf=%d\n", header, header2, bpf );
|
GST_DEBUG(0,"mp3parse: header=%08lX, header2=%08lX, bpf=%d", header, header2, bpf );
|
||||||
|
|
||||||
#define HDRMASK ~( (0xF<<12)/*bitrate*/ | (1<<9)/*padding*/ | (3<<4)/*mode extension*/ ) /* mask the bits which are allowed to differ between frames */
|
#define HDRMASK ~( (0xF<<12)/*bitrate*/ | (1<<9)/*padding*/ | (3<<4)/*mode extension*/ ) /* mask the bits which are allowed to differ between frames */
|
||||||
|
|
||||||
if ( (header2&HDRMASK) != (header&HDRMASK) ) { /* require 2 matching headers in a row */
|
if ( (header2&HDRMASK) != (header&HDRMASK) ) { /* require 2 matching headers in a row */
|
||||||
GST_DEBUG(0,"mp3parse: next header doesn't match (header=%08lX, header2=%08lX, bpf=%d)\n", header, header2, bpf );
|
GST_DEBUG(0,"mp3parse: next header doesn't match (header=%08lX, header2=%08lX, bpf=%d)", header, header2, bpf );
|
||||||
offset++; /* This frame is invalid. Start looking for a valid frame at the next position in the stream */
|
offset++; /* This frame is invalid. Start looking for a valid frame at the next position in the stream */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -319,7 +319,7 @@ gst_mp3parse_chain (GstPad *pad, GstBuffer *buf)
|
||||||
|
|
||||||
/* if we don't have the whole frame... */
|
/* if we don't have the whole frame... */
|
||||||
if ((size - offset) < bpf) {
|
if ((size - offset) < bpf) {
|
||||||
GST_DEBUG (0,"mp3parse: partial buffer needed %ld < %d \n",(size-offset), bpf);
|
GST_DEBUG (0,"mp3parse: partial buffer needed %ld < %d ",(size-offset), bpf);
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -327,7 +327,7 @@ gst_mp3parse_chain (GstPad *pad, GstBuffer *buf)
|
||||||
|
|
||||||
offset += bpf;
|
offset += bpf;
|
||||||
if (mp3parse->skip == 0) {
|
if (mp3parse->skip == 0) {
|
||||||
GST_DEBUG (0,"mp3parse: pushing buffer of %d bytes\n",GST_BUFFER_SIZE(outbuf));
|
GST_DEBUG (0,"mp3parse: pushing buffer of %d bytes",GST_BUFFER_SIZE(outbuf));
|
||||||
if (mp3parse->in_flush) {
|
if (mp3parse->in_flush) {
|
||||||
/* FIXME do some sort of flush event */
|
/* FIXME do some sort of flush event */
|
||||||
mp3parse->in_flush = FALSE;
|
mp3parse->in_flush = FALSE;
|
||||||
|
@ -336,21 +336,21 @@ gst_mp3parse_chain (GstPad *pad, GstBuffer *buf)
|
||||||
gst_pad_push(mp3parse->srcpad,outbuf);
|
gst_pad_push(mp3parse->srcpad,outbuf);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
GST_DEBUG (0,"mp3parse: skipping buffer of %d bytes\n",GST_BUFFER_SIZE(outbuf));
|
GST_DEBUG (0,"mp3parse: skipping buffer of %d bytes",GST_BUFFER_SIZE(outbuf));
|
||||||
gst_buffer_unref(outbuf);
|
gst_buffer_unref(outbuf);
|
||||||
mp3parse->skip--;
|
mp3parse->skip--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
offset++;
|
offset++;
|
||||||
if (!mp3parse->in_flush) GST_DEBUG (0,"mp3parse: *** wrong header, skipping byte (FIXME?)\n");
|
if (!mp3parse->in_flush) GST_DEBUG (0,"mp3parse: *** wrong header, skipping byte (FIXME?)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* if we have processed this block and there are still */
|
/* if we have processed this block and there are still */
|
||||||
/* bytes left not in a partial block, copy them over. */
|
/* bytes left not in a partial block, copy them over. */
|
||||||
if (size-offset > 0) {
|
if (size-offset > 0) {
|
||||||
glong remainder = (size - offset);
|
glong remainder = (size - offset);
|
||||||
GST_DEBUG (0,"mp3parse: partial buffer needed %ld for trailing bytes\n",remainder);
|
GST_DEBUG (0,"mp3parse: partial buffer needed %ld for trailing bytes",remainder);
|
||||||
|
|
||||||
outbuf = gst_buffer_create_sub(mp3parse->partialbuf,offset,remainder);
|
outbuf = gst_buffer_create_sub(mp3parse->partialbuf,offset,remainder);
|
||||||
gst_buffer_unref(mp3parse->partialbuf);
|
gst_buffer_unref(mp3parse->partialbuf);
|
||||||
|
@ -408,28 +408,28 @@ bpf_from_header (GstMPEGAudioParse *parse, unsigned long header)
|
||||||
static gboolean
|
static gboolean
|
||||||
head_check (unsigned long head)
|
head_check (unsigned long head)
|
||||||
{
|
{
|
||||||
GST_DEBUG (0,"checking mp3 header 0x%08lx\n",head);
|
GST_DEBUG (0,"checking mp3 header 0x%08lx",head);
|
||||||
/* if it's not a valid sync */
|
/* if it's not a valid sync */
|
||||||
if ((head & 0xffe00000) != 0xffe00000) {
|
if ((head & 0xffe00000) != 0xffe00000) {
|
||||||
GST_DEBUG (0,"invalid sync\n");return FALSE; }
|
GST_DEBUG (0,"invalid sync");return FALSE; }
|
||||||
/* if it's an invalid MPEG version */
|
/* if it's an invalid MPEG version */
|
||||||
if (((head >> 19) & 3) == 0x1) {
|
if (((head >> 19) & 3) == 0x1) {
|
||||||
GST_DEBUG (0,"invalid MPEG version\n");return FALSE; }
|
GST_DEBUG (0,"invalid MPEG version");return FALSE; }
|
||||||
/* if it's an invalid layer */
|
/* if it's an invalid layer */
|
||||||
if (!((head >> 17) & 3)) {
|
if (!((head >> 17) & 3)) {
|
||||||
GST_DEBUG (0,"invalid layer\n");return FALSE; }
|
GST_DEBUG (0,"invalid layer");return FALSE; }
|
||||||
/* if it's an invalid bitrate */
|
/* if it's an invalid bitrate */
|
||||||
if (((head >> 12) & 0xf) == 0x0) {
|
if (((head >> 12) & 0xf) == 0x0) {
|
||||||
GST_DEBUG (0,"invalid bitrate\n");return FALSE; }
|
GST_DEBUG (0,"invalid bitrate");return FALSE; }
|
||||||
if (((head >> 12) & 0xf) == 0xf) {
|
if (((head >> 12) & 0xf) == 0xf) {
|
||||||
GST_DEBUG (0,"invalid bitrate\n");return FALSE; }
|
GST_DEBUG (0,"invalid bitrate");return FALSE; }
|
||||||
/* if it's an invalid samplerate */
|
/* if it's an invalid samplerate */
|
||||||
if (((head >> 10) & 0x3) == 0x3) {
|
if (((head >> 10) & 0x3) == 0x3) {
|
||||||
GST_DEBUG (0,"invalid samplerate\n");return FALSE; }
|
GST_DEBUG (0,"invalid samplerate");return FALSE; }
|
||||||
if ((head & 0xffff0000) == 0xfffe0000) {
|
if ((head & 0xffff0000) == 0xfffe0000) {
|
||||||
GST_DEBUG (0,"invalid sync\n");return FALSE; }
|
GST_DEBUG (0,"invalid sync");return FALSE; }
|
||||||
if (head & 0x00000002) {
|
if (head & 0x00000002) {
|
||||||
GST_DEBUG (0,"invalid emphasis\n");return FALSE; }
|
GST_DEBUG (0,"invalid emphasis");return FALSE; }
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ num_filter = filter->buffer_size / sizeof(_TYPE_);
|
||||||
/* see if we've got any events coming through ... */
|
/* see if we've got any events coming through ... */
|
||||||
|
|
||||||
do {
|
do {
|
||||||
GST_DEBUG(0, "--- going to events\n");
|
GST_DEBUG(0, "--- going to events");
|
||||||
|
|
||||||
while (! filter->eos && GST_IS_EVENT(in)) {
|
while (! filter->eos && GST_IS_EVENT(in)) {
|
||||||
if (GST_EVENT_TYPE(in) == GST_EVENT_EOS) {
|
if (GST_EVENT_TYPE(in) == GST_EVENT_EOS) {
|
||||||
|
@ -24,7 +24,7 @@ do {
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
/* first handle data from the input buffer. */
|
/* first handle data from the input buffer. */
|
||||||
|
|
||||||
GST_DEBUG(0, "--- done with events, going to input\n");
|
GST_DEBUG(0, "--- done with events, going to input");
|
||||||
|
|
||||||
/* only update the input if there hasn't been an eos yet. */
|
/* only update the input if there hasn't been an eos yet. */
|
||||||
if (! filter->eos) {
|
if (! filter->eos) {
|
||||||
|
@ -70,7 +70,7 @@ do {
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
/* now handle output data. */
|
/* now handle output data. */
|
||||||
|
|
||||||
GST_DEBUG(0, "--- done with input, going to output\n");
|
GST_DEBUG(0, "--- done with input, going to output");
|
||||||
|
|
||||||
data_out = (_TYPE_ *) GST_BUFFER_DATA(out);
|
data_out = (_TYPE_ *) GST_BUFFER_DATA(out);
|
||||||
num_out = GST_BUFFER_SIZE(out) / sizeof(_TYPE_);
|
num_out = GST_BUFFER_SIZE(out) / sizeof(_TYPE_);
|
||||||
|
@ -102,7 +102,7 @@ do {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG(0, "--- done with output, pushing buffer %p\n", out);
|
GST_DEBUG(0, "--- done with output, pushing buffer %p", out);
|
||||||
|
|
||||||
gst_pad_push(filter->srcpad, out);
|
gst_pad_push(filter->srcpad, out);
|
||||||
|
|
||||||
|
|
|
@ -233,7 +233,7 @@ gst_smooth_chain (GstPad *pad, GstBuffer *buf)
|
||||||
data = GST_BUFFER_DATA (buf);
|
data = GST_BUFFER_DATA (buf);
|
||||||
size = GST_BUFFER_SIZE (buf);
|
size = GST_BUFFER_SIZE (buf);
|
||||||
|
|
||||||
GST_DEBUG (0,"smooth: have buffer of %d\n", GST_BUFFER_SIZE (buf));
|
GST_DEBUG (0,"smooth: have buffer of %d", GST_BUFFER_SIZE (buf));
|
||||||
|
|
||||||
outbuf = gst_buffer_new();
|
outbuf = gst_buffer_new();
|
||||||
GST_BUFFER_DATA (outbuf) = g_malloc (GST_BUFFER_SIZE (buf));
|
GST_BUFFER_DATA (outbuf) = g_malloc (GST_BUFFER_SIZE (buf));
|
||||||
|
|
|
@ -124,12 +124,12 @@ gst_smoothwave_init (GstSmoothWave *smoothwave)
|
||||||
/* gtk_widget_set_default_colormap (gdk_rgb_get_cmap()); */
|
/* gtk_widget_set_default_colormap (gdk_rgb_get_cmap()); */
|
||||||
/* gtk_widget_set_default_visual (gdk_rgb_get_visual()); */
|
/* gtk_widget_set_default_visual (gdk_rgb_get_visual()); */
|
||||||
|
|
||||||
/* GST_DEBUG (0,"creating palette\n"); */
|
/* GST_DEBUG (0,"creating palette"); */
|
||||||
for (i=0;i<256;i++)
|
for (i=0;i<256;i++)
|
||||||
palette[i] = (i << 16) || (i << 8);
|
palette[i] = (i << 16) || (i << 8);
|
||||||
/* GST_DEBUG (0,"creating cmap\n"); */
|
/* GST_DEBUG (0,"creating cmap"); */
|
||||||
smoothwave->cmap = gdk_rgb_cmap_new(palette,256);
|
smoothwave->cmap = gdk_rgb_cmap_new(palette,256);
|
||||||
/* GST_DEBUG (0,"created cmap\n"); */
|
/* GST_DEBUG (0,"created cmap"); */
|
||||||
/* gtk_widget_set_default_colormap (smoothwave->cmap); */
|
/* gtk_widget_set_default_colormap (smoothwave->cmap); */
|
||||||
|
|
||||||
smoothwave->image = gtk_drawing_area_new();
|
smoothwave->image = gtk_drawing_area_new();
|
||||||
|
@ -175,7 +175,7 @@ gst_smoothwave_chain (GstPad *pad, GstBuffer *buf)
|
||||||
|
|
||||||
qheight = smoothwave->height/4;
|
qheight = smoothwave->height/4;
|
||||||
|
|
||||||
/* GST_DEBUG (0,"traversing %d\n",smoothwave->width); */
|
/* GST_DEBUG (0,"traversing %d",smoothwave->width); */
|
||||||
for (i=0;i<MAX(smoothwave->width,samplecount);i++) {
|
for (i=0;i<MAX(smoothwave->width,samplecount);i++) {
|
||||||
gint16 y1 = (gint32)(samples[i*2] * qheight) / 32768 +
|
gint16 y1 = (gint32)(samples[i*2] * qheight) / 32768 +
|
||||||
qheight;
|
qheight;
|
||||||
|
@ -194,8 +194,8 @@ gst_smoothwave_chain (GstPad *pad, GstBuffer *buf)
|
||||||
ptr++;
|
ptr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GST_DEBUG (0,"drawing\n"); */
|
/* GST_DEBUG (0,"drawing"); */
|
||||||
/* GST_DEBUG (0,"gdk_draw_indexed_image(%p,%p,%d,%d,%d,%d,%s,%p,%d,%p);\n",
|
/* GST_DEBUG (0,"gdk_draw_indexed_image(%p,%p,%d,%d,%d,%d,%s,%p,%d,%p);",
|
||||||
smoothwave->image->window,
|
smoothwave->image->window,
|
||||||
smoothwave->image->style->fg_gc[GTK_STATE_NORMAL],
|
smoothwave->image->style->fg_gc[GTK_STATE_NORMAL],
|
||||||
0,0,smoothwave->width,smoothwave->height,
|
0,0,smoothwave->width,smoothwave->height,
|
||||||
|
|
Loading…
Reference in a new issue