Index: media/filters/ffmpeg_demuxer.cc |
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc |
index 56929bcf05172823e0aab9b2ba7d8fe64e4c81b2..118a63f1530586e16a8f4fdccd2516cbaaf29b2b 100644 |
--- a/media/filters/ffmpeg_demuxer.cc |
+++ b/media/filters/ffmpeg_demuxer.cc |
@@ -27,6 +27,10 @@ |
#include "media/filters/ffmpeg_glue.h" |
#include "media/filters/ffmpeg_h264_to_annex_b_bitstream_converter.h" |
+extern "C" { |
+#include "third_party/ffmpeg/libavcodec/avcodec.h" |
+} |
+ |
namespace media { |
// |
@@ -70,6 +74,12 @@ FFmpegDemuxerStream::FFmpegDemuxerStream( |
} |
void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) { |
+ |
+ uint8_t *side_data; |
fgalligan1
2013/02/12 01:20:58
nit: asterisk adjacent to type.
vigneshv
2013/02/14 19:06:14
Done.
|
+ int side_data_size = 0; |
+ //int i; |
fgalligan1
2013/02/12 01:20:58
remove
vigneshv
2013/02/14 19:06:14
Done.
|
+ AVPacket *pkt; |
fgalligan1
2013/02/12 01:20:58
nit: asterisk adjacent to type.
vigneshv
2013/02/14 19:06:14
Done.
|
+ |
DCHECK(message_loop_->BelongsToCurrentThread()); |
if (stopped_ || end_of_stream_) { |
@@ -83,11 +93,21 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) { |
LOG(ERROR) << "Format conversion failed."; |
} |
+ // Get the alpha data if any |
+ pkt = packet.get(); |
+ av_packet_split_side_data(pkt); |
+ side_data = av_packet_get_side_data(pkt, |
+ AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, |
+ &side_data_size); |
+ |
// If a packet is returned by FFmpeg's av_parser_parse2() the packet will |
// reference inner memory of FFmpeg. As such we should transfer the packet |
// into memory we control. |
scoped_refptr<DecoderBuffer> buffer; |
- buffer = DecoderBuffer::CopyFrom(packet->data, packet->size); |
+ buffer = DecoderBuffer::CopyFrom(pkt->data, pkt->size); |
+ if (side_data_size) { |
+ buffer->SetSideData(side_data, side_data_size); |
+ } |
buffer->SetTimestamp(ConvertStreamTimestamp( |
stream_->time_base, packet->pts)); |
buffer->SetDuration(ConvertStreamTimestamp( |