diff options
author | Thomas Vander Stichele <thomas@apestaart.org> | 2004-03-15 19:32:27 +0000 |
---|---|---|
committer | Thomas Vander Stichele <thomas@apestaart.org> | 2004-03-15 19:32:27 +0000 |
commit | 4fd57bbe3fef59592a8664dcc9fa2ab32ae99c69 (patch) | |
tree | 8f41b30e571aa6ed88b53f5471d5e38461136e60 /gst/mpeg1sys | |
parent | 9f4226fe55f09cf5809376b467aa3f46dbf7b5c2 (diff) | |
download | gst-plugins-bad-4fd57bbe3fef59592a8664dcc9fa2ab32ae99c69.tar.gz gst-plugins-bad-4fd57bbe3fef59592a8664dcc9fa2ab32ae99c69.tar.bz2 gst-plugins-bad-4fd57bbe3fef59592a8664dcc9fa2ab32ae99c69.zip |
don't mix tabs and spaces
Original commit message from CVS:
don't mix tabs and spaces
Diffstat (limited to 'gst/mpeg1sys')
-rw-r--r-- | gst/mpeg1sys/buffer.c | 188 | ||||
-rw-r--r-- | gst/mpeg1sys/gstmpeg1systemencode.c | 105 | ||||
-rw-r--r-- | gst/mpeg1sys/systems.c | 10 |
3 files changed, 152 insertions, 151 deletions
diff --git a/gst/mpeg1sys/buffer.c b/gst/mpeg1sys/buffer.c index ceb67d07..6bfcbc06 100644 --- a/gst/mpeg1sys/buffer.c +++ b/gst/mpeg1sys/buffer.c @@ -139,7 +139,7 @@ mpeg1mux_buffer_queue (Mpeg1MuxBuffer * mb, GstBuffer * buf) } else { mb->buffer = g_realloc (mb->buffer, mb->length + GST_BUFFER_SIZE (buf)); memcpy (mb->buffer + mb->length, GST_BUFFER_DATA (buf), - GST_BUFFER_SIZE (buf)); + GST_BUFFER_SIZE (buf)); mb->length += GST_BUFFER_SIZE (buf); } @@ -169,7 +169,7 @@ mpeg1mux_buffer_update_queued (Mpeg1MuxBuffer * mb, guint64 scr) queued_list = g_list_first (mb->queued_list); } else { GST_DEBUG ("queued in buffer %ld, %" G_GUINT64_FORMAT, - tc->original_length, tc->DTS); + tc->original_length, tc->DTS); total_queued += tc->original_length; queued_list = g_list_next (queued_list); } @@ -208,18 +208,18 @@ mpeg1mux_buffer_shrink (Mpeg1MuxBuffer * mb, gulong size) consumed += tc->length; while (size >= consumed) { GST_DEBUG ("removing timecode: %" G_GUINT64_FORMAT " %" G_GUINT64_FORMAT - " %lu %lu", tc->DTS, tc->PTS, tc->length, consumed); + " %lu %lu", tc->DTS, tc->PTS, tc->length, consumed); mb->timecode_list = g_list_remove_link (mb->timecode_list, timecode_list); mb->queued_list = g_list_append (mb->queued_list, tc); timecode_list = g_list_first (mb->timecode_list); tc = (Mpeg1MuxTimecode *) timecode_list->data; consumed += tc->length; GST_DEBUG ("next timecode: %" G_GUINT64_FORMAT " %" G_GUINT64_FORMAT - " %lu %lu", tc->DTS, tc->PTS, tc->length, consumed); + " %lu %lu", tc->DTS, tc->PTS, tc->length, consumed); } mb->new_frame = TRUE; GST_DEBUG ("leftover frame size from %lu to %lu ", tc->length, - consumed - size); + consumed - size); tc->length = consumed - size; } @@ -275,17 +275,17 @@ mpeg1mux_buffer_update_video_info (Mpeg1MuxBuffer * mb) mb->info.video.picture_rate = gst_getbits4 (&gb); mb->info.video.bit_rate = gst_getbits18 (&gb); if (gst_getbits1 (&gb) != 1) { - g_print ("mpeg1mux::update_video_info: marker bit error\n"); + g_print ("mpeg1mux::update_video_info: marker bit error\n"); } mb->info.video.vbv_buffer_size = gst_getbits10 (&gb); mb->info.video.CSPF = gst_getbits1 (&gb); mb->info.video.secs_per_frame = - 1. / picture_rates[mb->info.video.picture_rate]; + 1. / picture_rates[mb->info.video.picture_rate]; mb->info.video.decoding_order = 0; mb->info.video.group_order = 0; GST_DEBUG ("mpeg1mux::update_video_info: secs per frame %g", - mb->info.video.secs_per_frame); + mb->info.video.secs_per_frame); } else { g_print ("mpeg1mux::update_video_info: Invalid MPEG Video header\n"); } @@ -298,82 +298,82 @@ mpeg1mux_buffer_update_video_info (Mpeg1MuxBuffer * mb) offset++; /* if it's zero, increment the zero count */ if (byte == 0) { - sync_zeros++; - /*GST_DEBUG ("mpeg1mux::update_video_info: found zero #%d at %lu",sync_zeros,offset-1); */ + sync_zeros++; + /*GST_DEBUG ("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 */ else if ((byte == 1) && (sync_zeros >= 2)) { - GST_DEBUG ("mpeg1mux::update_video_info: synced at %lu", offset - 1); - have_sync = TRUE; - sync_zeros = 0; + GST_DEBUG ("mpeg1mux::update_video_info: synced at %lu", offset - 1); + have_sync = TRUE; + sync_zeros = 0; } /* if it's anything else, we've lost it completely */ else - sync_zeros = 0; + sync_zeros = 0; /* then snag the chunk ID */ } else if (id == 0) { id = *(data + offset); GST_DEBUG ("mpeg1mux::update_video_info: got id 0x%02lX", id); id = (SYNCWORD_START << 8) + id; switch (id) { - case SEQUENCE_HEADER: - GST_DEBUG ("mpeg1mux::update_video_info: sequence header"); - break; - case GROUP_START: - GST_DEBUG ("mpeg1mux::update_video_info: group start"); - mb->info.video.group_order = 0; - break; - case PICTURE_START: - /* skip the first access unit */ - if (mb->info.video.decoding_order != 0) { - Mpeg1MuxTimecode *tc; - - GST_DEBUG ("mpeg1mux::update_video_info: PTS %" G_GUINT64_FORMAT - ", DTS %" G_GUINT64_FORMAT ", length %lu", - mb->info.video.current_PTS, mb->info.video.current_DTS, - offset - mb->current_start - 3); - - tc = (Mpeg1MuxTimecode *) g_malloc (sizeof (Mpeg1MuxTimecode)); - tc->length = offset - mb->current_start - 3; - tc->original_length = tc->length; - tc->frame_type = mb->info.video.current_type; - tc->DTS = mb->info.video.current_DTS; - tc->PTS = mb->info.video.current_PTS; - - mb->timecode_list = g_list_append (mb->timecode_list, tc); - - if (mb->info.video.decoding_order == 0) { - mb->next_frame_time = tc->DTS; - } - - mb->current_start = offset - 3; - } - - temp = (*(data + offset + 1) << 8) + *(data + offset + 2); - temporal_reference = (temp & 0xffc0) >> 6; - mb->info.video.current_type = (temp & 0x0038) >> 3; - GST_DEBUG - ("mpeg1mux::update_video_info: picture start temporal_ref:%d type:%s Frame", - temporal_reference, - 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_PTS = - (temporal_reference - mb->info.video.group_order + 1 + - mb->info.video.decoding_order) * mb->info.video.secs_per_frame * - CLOCKS; - - mb->info.video.decoding_order++; - mb->info.video.group_order++; - - - offset++; - break; - case SEQUENCE_END: - GST_DEBUG ("mpeg1mux::update_video_info: sequence end"); - break; + case SEQUENCE_HEADER: + GST_DEBUG ("mpeg1mux::update_video_info: sequence header"); + break; + case GROUP_START: + GST_DEBUG ("mpeg1mux::update_video_info: group start"); + mb->info.video.group_order = 0; + break; + case PICTURE_START: + /* skip the first access unit */ + if (mb->info.video.decoding_order != 0) { + Mpeg1MuxTimecode *tc; + + GST_DEBUG ("mpeg1mux::update_video_info: PTS %" G_GUINT64_FORMAT + ", DTS %" G_GUINT64_FORMAT ", length %lu", + mb->info.video.current_PTS, mb->info.video.current_DTS, + offset - mb->current_start - 3); + + tc = (Mpeg1MuxTimecode *) g_malloc (sizeof (Mpeg1MuxTimecode)); + tc->length = offset - mb->current_start - 3; + tc->original_length = tc->length; + tc->frame_type = mb->info.video.current_type; + tc->DTS = mb->info.video.current_DTS; + tc->PTS = mb->info.video.current_PTS; + + mb->timecode_list = g_list_append (mb->timecode_list, tc); + + if (mb->info.video.decoding_order == 0) { + mb->next_frame_time = tc->DTS; + } + + mb->current_start = offset - 3; + } + + temp = (*(data + offset + 1) << 8) + *(data + offset + 2); + temporal_reference = (temp & 0xffc0) >> 6; + mb->info.video.current_type = (temp & 0x0038) >> 3; + GST_DEBUG + ("mpeg1mux::update_video_info: picture start temporal_ref:%d type:%s Frame", + temporal_reference, + 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_PTS = + (temporal_reference - mb->info.video.group_order + 1 + + mb->info.video.decoding_order) * mb->info.video.secs_per_frame * + CLOCKS; + + mb->info.video.decoding_order++; + mb->info.video.group_order++; + + + offset++; + break; + case SEQUENCE_END: + GST_DEBUG ("mpeg1mux::update_video_info: sequence end"); + break; } /* prepare for next sync */ offset++; @@ -411,30 +411,30 @@ mpeg1mux_buffer_update_audio_info (Mpeg1MuxBuffer * mb) mb->info.audio.layer = 4 - layer_index; lsf = (id & (1 << 20)) ? ((id & (1 << 19)) ? 0 : 1) : 1; mb->info.audio.bit_rate = - bitrate_index[lsf][mb->info.audio.layer - 1][((id >> 12) & 0xf)]; + bitrate_index[lsf][mb->info.audio.layer - 1][((id >> 12) & 0xf)]; samplerate_index = (id >> 10) & 0x3; padding = (id >> 9) & 0x1; if (mb->info.audio.layer == 1) { - bpf = mb->info.audio.bit_rate * 12000; - bpf /= frequency[samplerate_index]; - bpf = ((bpf + padding) << 2); + bpf = mb->info.audio.bit_rate * 12000; + bpf /= frequency[samplerate_index]; + bpf = ((bpf + padding) << 2); } else { - bpf = mb->info.audio.bit_rate * 144000; - bpf /= frequency[samplerate_index]; - bpf += padding; + bpf = mb->info.audio.bit_rate * 144000; + bpf /= frequency[samplerate_index]; + bpf += padding; } mb->info.audio.framesize = bpf; GST_DEBUG ("mpeg1mux::update_audio_info: samples per second %d", - samplerate_index); + samplerate_index); gst_getbits_init (&gb, NULL, NULL); gst_getbits_newbuf (&gb, data, mb->length); gst_flushbitsn (&gb, 12); if (gst_getbits1 (&gb) != 1) { - g_print ("mpeg1mux::update_audio_info: marker bit error\n"); + g_print ("mpeg1mux::update_audio_info: marker bit error\n"); } gst_flushbitsn (&gb, 2); mb->info.audio.protection = gst_getbits1 (&gb); @@ -450,15 +450,15 @@ mpeg1mux_buffer_update_audio_info (Mpeg1MuxBuffer * mb) GST_DEBUG ("mpeg1mux::update_audio_info: layer %d", mb->info.audio.layer); GST_DEBUG ("mpeg1mux::update_audio_info: bit_rate %d", - mb->info.audio.bit_rate); + mb->info.audio.bit_rate); GST_DEBUG ("mpeg1mux::update_audio_info: frequency %d", - mb->info.audio.frequency); + mb->info.audio.frequency); mb->info.audio.samples_per_second = - (double) dfrequency[mb->info.audio.frequency]; + (double) dfrequency[mb->info.audio.frequency]; GST_DEBUG ("mpeg1mux::update_audio_info: samples per second %g", - mb->info.audio.samples_per_second); + mb->info.audio.samples_per_second); mb->info.audio.decoding_order = 0; @@ -468,11 +468,11 @@ mpeg1mux_buffer_update_audio_info (Mpeg1MuxBuffer * mb) tc->frame_type = FRAME_TYPE_AUDIO; 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.decoding_order * samples[mb->info.audio.layer] / + mb->info.audio.samples_per_second * 90. + startup_delay; GST_DEBUG ("mpeg1mux::update_audio_info: PTS %" G_GUINT64_FORMAT - ", length %u", mb->info.audio.current_PTS, mb->info.audio.framesize); + ", length %u", mb->info.audio.current_PTS, mb->info.audio.framesize); tc->PTS = mb->info.audio.current_PTS; tc->DTS = mb->info.audio.current_PTS; mb->timecode_list = g_list_append (mb->timecode_list, tc); @@ -493,7 +493,7 @@ mpeg1mux_buffer_update_audio_info (Mpeg1MuxBuffer * mb) mb->info.audio.layer = 4 - layer_index; lsf = (id & (1 << 20)) ? ((id & (1 << 19)) ? 0 : 1) : 1; mb->info.audio.bit_rate = - bitrate_index[lsf][mb->info.audio.layer - 1][((id >> 12) & 0xf)]; + bitrate_index[lsf][mb->info.audio.layer - 1][((id >> 12) & 0xf)]; samplerate_index = (id >> 10) & 0x3; padding = (id >> 9) & 0x1; @@ -514,16 +514,16 @@ mpeg1mux_buffer_update_audio_info (Mpeg1MuxBuffer * mb) mb->current_start = offset + bpf; mb->info.audio.samples_per_second = - (double) dfrequency[mb->info.audio.frequency]; + (double) dfrequency[mb->info.audio.frequency]; mb->info.audio.current_PTS = - (mb->info.audio.decoding_order * samples[mb->info.audio.layer]) / - mb->info.audio.samples_per_second * 90.; + (mb->info.audio.decoding_order * samples[mb->info.audio.layer]) / + mb->info.audio.samples_per_second * 90.; tc->DTS = tc->PTS = mb->info.audio.current_PTS; GST_DEBUG ("mpeg1mux::update_audio_info: PTS %" G_GUINT64_FORMAT ", %" - G_GUINT64_FORMAT " length %lu", mb->info.audio.current_PTS, tc->PTS, - tc->length); + G_GUINT64_FORMAT " length %lu", mb->info.audio.current_PTS, tc->PTS, + tc->length); mb->timecode_list = g_list_append (mb->timecode_list, tc); mb->info.audio.decoding_order++; diff --git a/gst/mpeg1sys/gstmpeg1systemencode.c b/gst/mpeg1sys/gstmpeg1systemencode.c index a071f0c4..c8698430 100644 --- a/gst/mpeg1sys/gstmpeg1systemencode.c +++ b/gst/mpeg1sys/gstmpeg1systemencode.c @@ -61,7 +61,7 @@ GST_STATIC_PAD_TEMPLATE ("video_%d", GST_PAD_SINK, GST_PAD_REQUEST, GST_STATIC_CAPS ("video/mpeg, " - "mpegversion = (int) 1, " "systemstream = (boolean) FALSE") + "mpegversion = (int) 1, " "systemstream = (boolean) FALSE") ); static GstStaticPadTemplate audio_sink_factory = @@ -69,7 +69,7 @@ GST_STATIC_PAD_TEMPLATE ("audio_%d", GST_PAD_SINK, GST_PAD_REQUEST, GST_STATIC_CAPS ("audio/mpeg, " - "mpegversion = (int) 1, " "layer = (int) [ 1, 2 ] ") + "mpegversion = (int) 1, " "layer = (int) [ 1, 2 ] ") ); static void gst_system_encode_class_init (GstMPEG1SystemEncodeClass * klass); @@ -107,9 +107,10 @@ gst_mpeg1_system_encode_get_type (void) (GInstanceInitFunc) gst_system_encode_init, NULL }; + system_encode_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstMPEG1SystemEncode", - &system_encode_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstMPEG1SystemEncode", + &system_encode_info, 0); } return system_encode_type; } @@ -194,7 +195,7 @@ gst_system_encode_request_new_pad (GstElement * element, GstPadTemplate * templ, g_print ("%s\n", name); newpad = gst_pad_new_from_template (templ, name); gst_pad_set_element_private (newpad, - GINT_TO_POINTER (system_encode->num_audio_pads)); + GINT_TO_POINTER (system_encode->num_audio_pads)); system_encode->audio_pad[system_encode->num_audio_pads] = newpad; system_encode->num_audio_pads++; @@ -204,7 +205,7 @@ gst_system_encode_request_new_pad (GstElement * element, GstPadTemplate * templ, g_print ("%s\n", name); newpad = gst_pad_new_from_template (templ, name); gst_pad_set_element_private (newpad, - GINT_TO_POINTER (system_encode->num_video_pads)); + GINT_TO_POINTER (system_encode->num_video_pads)); system_encode->video_pad[system_encode->num_video_pads] = newpad; system_encode->num_video_pads++; @@ -233,13 +234,13 @@ gst_system_encode_pick_streams (GList * mta, if (system_encode->which_streams & STREAMS_VIDEO) { if (system_encode->video_buffer->next_frame_time < - lowest - system_encode->video_delay) { + lowest - system_encode->video_delay) { lowest = system_encode->video_buffer->next_frame_time; } } if (system_encode->which_streams & STREAMS_AUDIO) { if (system_encode->audio_buffer->next_frame_time < - lowest - system_encode->audio_delay) { + lowest - system_encode->audio_delay) { lowest = system_encode->audio_buffer->next_frame_time; } } @@ -263,25 +264,25 @@ gst_system_encode_have_data (GstMPEG1SystemEncode * system_encode) if (system_encode->which_streams == (STREAMS_VIDEO | STREAMS_AUDIO)) { if (MPEG1MUX_BUFFER_QUEUED (system_encode->audio_buffer) > 2 && - MPEG1MUX_BUFFER_SPACE (system_encode->audio_buffer) > - system_encode->packet_size * 2 - && MPEG1MUX_BUFFER_QUEUED (system_encode->video_buffer) > 2 - && MPEG1MUX_BUFFER_SPACE (system_encode->video_buffer) > - system_encode->packet_size * 2) { + MPEG1MUX_BUFFER_SPACE (system_encode->audio_buffer) > + system_encode->packet_size * 2 + && MPEG1MUX_BUFFER_QUEUED (system_encode->video_buffer) > 2 + && MPEG1MUX_BUFFER_SPACE (system_encode->video_buffer) > + system_encode->packet_size * 2) { return TRUE; } } if (system_encode->which_streams == STREAMS_VIDEO) { if (MPEG1MUX_BUFFER_QUEUED (system_encode->video_buffer) > 2 && - MPEG1MUX_BUFFER_SPACE (system_encode->video_buffer) > - system_encode->packet_size * 2) { + MPEG1MUX_BUFFER_SPACE (system_encode->video_buffer) > + system_encode->packet_size * 2) { return TRUE; } } if (system_encode->which_streams == STREAMS_VIDEO) { if (MPEG1MUX_BUFFER_QUEUED (system_encode->audio_buffer) > 2 && - MPEG1MUX_BUFFER_SPACE (system_encode->audio_buffer) > - system_encode->packet_size * 2) { + MPEG1MUX_BUFFER_SPACE (system_encode->audio_buffer) > + system_encode->packet_size * 2) { return TRUE; } } @@ -321,12 +322,12 @@ gst_system_setup_multiplex (GstMPEG1SystemEncode * system_encode) if (system_encode->which_streams & STREAMS_VIDEO) { system_encode->video_rate = - system_encode->video_buffer->info.video.bit_rate * 50; + system_encode->video_buffer->info.video.bit_rate * 50; } else system_encode->video_rate = 0; if (system_encode->which_streams & STREAMS_AUDIO) system_encode->audio_rate = - system_encode->audio_buffer->info.audio.bit_rate * 128; + system_encode->audio_buffer->info.audio.bit_rate * 128; else system_encode->audio_rate = 0; @@ -335,11 +336,11 @@ gst_system_setup_multiplex (GstMPEG1SystemEncode * system_encode) system_encode->dmux_rate = ceil ((double) (system_encode->data_rate) * ((double) (system_encode->packet_size) / - (double) (system_encode->min_packet_data) + - ((double) (system_encode->packet_size) / - (double) (system_encode->max_packet_data) * - (double) (system_encode->packets_per_pack - - 1.))) / (double) (system_encode->packets_per_pack)); + (double) (system_encode->min_packet_data) + + ((double) (system_encode->packet_size) / + (double) (system_encode->max_packet_data) * + (double) (system_encode->packets_per_pack - + 1.))) / (double) (system_encode->packets_per_pack)); system_encode->data_rate = ceil (system_encode->dmux_rate / 50.) * 50; GST_DEBUG @@ -363,9 +364,9 @@ gst_system_setup_multiplex (GstMPEG1SystemEncode * system_encode) system_encode->delay = ((double) system_encode->sectors_delay + ceil ((double) video_tc->length / - (double) system_encode->min_packet_data) + + (double) system_encode->min_packet_data) + ceil ((double) video_tc->length / - (double) system_encode->min_packet_data)) * + (double) system_encode->min_packet_data)) * (double) system_encode->packet_size / system_encode->dmux_rate * (double) CLOCKS; @@ -406,15 +407,15 @@ gst_system_encode_multiplex (GstMPEG1SystemEncode * system_encode) if (system_encode->mta == NULL) { system_encode->mta = - gst_system_encode_pick_streams (system_encode->mta, system_encode); + gst_system_encode_pick_streams (system_encode->mta, system_encode); } if (system_encode->mta == NULL) break; system_encode->SCR = - (guint64) (system_encode->bytes_output + - LAST_SCR_BYTE_IN_PACK) * CLOCKS / system_encode->dmux_rate; + (guint64) (system_encode->bytes_output + + LAST_SCR_BYTE_IN_PACK) * CLOCKS / system_encode->dmux_rate; streams = g_list_first (system_encode->mta); @@ -422,11 +423,11 @@ gst_system_encode_multiplex (GstMPEG1SystemEncode * system_encode) if (system_encode->current_pack == system_encode->packets_per_pack) { create_pack (system_encode->pack, system_encode->SCR, - system_encode->mux_rate); + system_encode->mux_rate); create_sys_header (system_encode->sys_header, system_encode->mux_rate, 1, - 1, 1, 1, 1, 1, AUDIO_STR_0, 0, system_encode->audio_buffer_size / 128, - VIDEO_STR_0, 1, system_encode->video_buffer_size / 1024, - system_encode->which_streams); + 1, 1, 1, 1, 1, AUDIO_STR_0, 0, system_encode->audio_buffer_size / 128, + VIDEO_STR_0, 1, system_encode->video_buffer_size / 1024, + system_encode->which_streams); system_encode->current_pack = 0; pack = system_encode->pack; sys_header = system_encode->sys_header; @@ -440,11 +441,11 @@ gst_system_encode_multiplex (GstMPEG1SystemEncode * system_encode) if (mb->new_frame) { GST_DEBUG ("system_encode::multiplex: new frame"); if (tc->frame_type == FRAME_TYPE_AUDIO - || tc->frame_type == FRAME_TYPE_IFRAME - || tc->frame_type == FRAME_TYPE_PFRAME) { - timestamps = TIMESTAMPS_PTS; + || tc->frame_type == FRAME_TYPE_IFRAME + || tc->frame_type == FRAME_TYPE_PFRAME) { + timestamps = TIMESTAMPS_PTS; } else { - timestamps = TIMESTAMPS_PTS_DTS; + timestamps = TIMESTAMPS_PTS_DTS; } } else { timestamps = TIMESTAMPS_NO; @@ -452,7 +453,7 @@ gst_system_encode_multiplex (GstMPEG1SystemEncode * system_encode) if (tc->frame_type != FRAME_TYPE_AUDIO) { if (tc->PTS < system_encode->startup_delay) - system_encode->startup_delay = tc->PTS; + system_encode->startup_delay = tc->PTS; } if (tc->frame_type == FRAME_TYPE_AUDIO) { @@ -475,27 +476,27 @@ gst_system_encode_multiplex (GstMPEG1SystemEncode * system_encode) /* write the pack/packet here */ create_sector (system_encode->sector, pack, sys_header, - system_encode->packet_size, - MPEG1MUX_BUFFER_DATA (mb), mb->stream_id, buffer_scale, - buffer_size, TRUE, PTS, DTS, - timestamps, system_encode->which_streams); + system_encode->packet_size, + MPEG1MUX_BUFFER_DATA (mb), mb->stream_id, buffer_scale, + buffer_size, TRUE, PTS, DTS, + timestamps, system_encode->which_streams); /* update mta */ system_encode->mta = - gst_system_encode_update_mta (system_encode, system_encode->mta, - system_encode->sector->length_of_packet_data); + gst_system_encode_update_mta (system_encode, system_encode->mta, + system_encode->sector->length_of_packet_data); } else { /* write a padding packet */ create_sector (system_encode->sector, pack, sys_header, - system_encode->packet_size, NULL, PADDING_STR, 0, - 0, FALSE, 0, 0, TIMESTAMPS_NO, system_encode->which_streams); + system_encode->packet_size, NULL, PADDING_STR, 0, + 0, FALSE, 0, 0, TIMESTAMPS_NO, system_encode->which_streams); } outbuf = gst_buffer_new (); GST_BUFFER_DATA (outbuf) = - g_malloc (system_encode->sector->length_of_sector); + g_malloc (system_encode->sector->length_of_sector); GST_BUFFER_SIZE (outbuf) = system_encode->sector->length_of_sector; memcpy (GST_BUFFER_DATA (outbuf), system_encode->sector->buf, - system_encode->sector->length_of_sector); + system_encode->sector->length_of_sector); system_encode->bytes_output += GST_BUFFER_SIZE (outbuf); gst_pad_push (system_encode->srcpad, GST_DATA (outbuf)); @@ -535,15 +536,15 @@ gst_system_encode_chain (GstPad * pad, GstData * _data) if (strncmp (padname, "audio_", 6) == 0) { channel = atoi (&padname[6]); GST_DEBUG - ("gst_system_encode_chain: got audio buffer in from audio channel %02d", - channel); + ("gst_system_encode_chain: got audio buffer in from audio channel %02d", + channel); mpeg1mux_buffer_queue (system_encode->audio_buffer, buf); } else if (strncmp (padname, "video_", 6) == 0) { channel = atoi (&padname[6]); GST_DEBUG - ("gst_system_encode_chain: got video buffer in from video channel %02d", - channel); + ("gst_system_encode_chain: got video buffer in from video channel %02d", + channel); mpeg1mux_buffer_queue (system_encode->video_buffer, buf); diff --git a/gst/mpeg1sys/systems.c b/gst/mpeg1sys/systems.c index 20e7bd90..c0541c5b 100644 --- a/gst/mpeg1sys/systems.c +++ b/gst/mpeg1sys/systems.c @@ -124,7 +124,7 @@ create_sector (sector, pack, sys_header, if (buffers) { *(index++) = (unsigned char) (0x40 | - (buffer_scale << 5) | (buffer_size >> 8)); + (buffer_scale << 5) | (buffer_size >> 8)); *(index++) = (unsigned char) (buffer_size & 0xff); } @@ -164,9 +164,9 @@ create_sector (sector, pack, sys_header, if (tmp != i) { packet_size -= (i - tmp); *(size_offset++) = - (unsigned char) ((packet_size - PACKET_HEADER_SIZE) >> 8); + (unsigned char) ((packet_size - PACKET_HEADER_SIZE) >> 8); *(size_offset++) = - (unsigned char) ((packet_size - PACKET_HEADER_SIZE) & 0xff); + (unsigned char) ((packet_size - PACKET_HEADER_SIZE) & 0xff); /* zero byte stuffing in the last Packet of a stream */ /* we don't need this any more, since we shortenend the packet */ @@ -281,14 +281,14 @@ create_sys_header (sys_header, rate_bound, audio_bound, if (which_streams & STREAMS_AUDIO) { *(index++) = stream1; *(index++) = (unsigned char) (0xc0 | - (buffer1_scale << 5) | (buffer1_size >> 8)); + (buffer1_scale << 5) | (buffer1_size >> 8)); *(index++) = (unsigned char) (buffer1_size & 0xff); } if (which_streams & STREAMS_VIDEO) { *(index++) = stream2; *(index++) = (unsigned char) (0xc0 | - (buffer2_scale << 5) | (buffer2_size >> 8)); + (buffer2_scale << 5) | (buffer2_size >> 8)); *(index++) = (unsigned char) (buffer2_size & 0xff); } |