summaryrefslogtreecommitdiffstats
path: root/media/formats/mp2t
diff options
context:
space:
mode:
Diffstat (limited to 'media/formats/mp2t')
-rw-r--r--media/formats/mp2t/es_adapter_video_unittest.cc2
-rw-r--r--media/formats/mp2t/es_parser_adts.cc8
-rw-r--r--media/formats/mp2t/es_parser_h264.cc9
-rw-r--r--media/formats/mp2t/es_parser_h264.h5
-rw-r--r--media/formats/mp2t/es_parser_mpeg1audio.cc9
5 files changed, 16 insertions, 17 deletions
diff --git a/media/formats/mp2t/es_adapter_video_unittest.cc b/media/formats/mp2t/es_adapter_video_unittest.cc
index a6e1684..5946d21 100644
--- a/media/formats/mp2t/es_adapter_video_unittest.cc
+++ b/media/formats/mp2t/es_adapter_video_unittest.cc
@@ -32,7 +32,7 @@ VideoDecoderConfig CreateFakeVideoConfig() {
gfx::Size natural_size(320, 240);
return VideoDecoderConfig(kCodecH264, H264PROFILE_MAIN, PIXEL_FORMAT_I420,
COLOR_SPACE_UNSPECIFIED, coded_size, visible_rect,
- natural_size, EmptyExtraData(), false);
+ natural_size, EmptyExtraData(), Unencrypted());
}
StreamParserBuffer::BufferQueue
diff --git a/media/formats/mp2t/es_parser_adts.cc b/media/formats/mp2t/es_parser_adts.cc
index 5a90973..b209d66 100644
--- a/media/formats/mp2t/es_parser_adts.cc
+++ b/media/formats/mp2t/es_parser_adts.cc
@@ -13,6 +13,7 @@
#include "media/base/audio_timestamp_helper.h"
#include "media/base/bit_reader.h"
#include "media/base/channel_layout.h"
+#include "media/base/media_util.h"
#include "media/base/stream_parser_buffer.h"
#include "media/base/timestamp_constants.h"
#include "media/formats/common/offset_byte_queue.h"
@@ -227,12 +228,9 @@ bool EsParserAdts::UpdateAudioConfiguration(const uint8_t* adts_header) {
extra_data.push_back(static_cast<uint8_t>(extra_data_int & 0xff));
AudioDecoderConfig audio_decoder_config(
- kCodecAAC,
- kSampleFormatS16,
+ kCodecAAC, kSampleFormatS16,
kADTSChannelLayoutTable[channel_configuration],
- extended_samples_per_second,
- extra_data,
- false);
+ extended_samples_per_second, extra_data, Unencrypted());
if (!audio_decoder_config.Matches(last_audio_decoder_config_)) {
DVLOG(1) << "Sampling frequency: " << samples_per_second;
diff --git a/media/formats/mp2t/es_parser_h264.cc b/media/formats/mp2t/es_parser_h264.cc
index dc8315c..3b47fec 100644
--- a/media/formats/mp2t/es_parser_h264.cc
+++ b/media/formats/mp2t/es_parser_h264.cc
@@ -6,6 +6,8 @@
#include "base/logging.h"
#include "base/numerics/safe_conversions.h"
+#include "media/base/encryption_scheme.h"
+#include "media/base/media_util.h"
#include "media/base/stream_parser_buffer.h"
#include "media/base/timestamp_constants.h"
#include "media/base/video_frame.h"
@@ -262,7 +264,7 @@ bool EsParserH264::EmitFrame(int64_t access_unit_pos,
const H264SPS* sps = h264_parser_->GetSPS(pps->seq_parameter_set_id);
if (!sps)
return false;
- RCHECK(UpdateVideoDecoderConfig(sps));
+ RCHECK(UpdateVideoDecoderConfig(sps, Unencrypted()));
}
// Emit a frame.
@@ -287,7 +289,8 @@ bool EsParserH264::EmitFrame(int64_t access_unit_pos,
return es_adapter_.OnNewBuffer(stream_parser_buffer);
}
-bool EsParserH264::UpdateVideoDecoderConfig(const H264SPS* sps) {
+bool EsParserH264::UpdateVideoDecoderConfig(const H264SPS* sps,
+ const EncryptionScheme& scheme) {
// Set the SAR to 1 when not specified in the H264 stream.
int sar_width = (sps->sar_width == 0) ? 1 : sps->sar_width;
int sar_height = (sps->sar_height == 0) ? 1 : sps->sar_height;
@@ -314,7 +317,7 @@ bool EsParserH264::UpdateVideoDecoderConfig(const H264SPS* sps) {
VideoDecoderConfig video_decoder_config(
kCodecH264, ProfileIDCToVideoCodecProfile(sps->profile_idc),
PIXEL_FORMAT_YV12, COLOR_SPACE_HD_REC709, coded_size, visible_rect,
- natural_size, std::vector<uint8_t>(), false);
+ natural_size, EmptyExtraData(), scheme);
if (!video_decoder_config.Matches(last_video_decoder_config_)) {
DVLOG(1) << "Profile IDC: " << sps->profile_idc;
diff --git a/media/formats/mp2t/es_parser_h264.h b/media/formats/mp2t/es_parser_h264.h
index 9ce8ea0..184ac07 100644
--- a/media/formats/mp2t/es_parser_h264.h
+++ b/media/formats/mp2t/es_parser_h264.h
@@ -7,7 +7,6 @@
#include <stdint.h>
-#include <list>
#include <utility>
#include "base/callback.h"
@@ -21,6 +20,7 @@
#include "media/formats/mp2t/es_parser.h"
namespace media {
+class EncryptionScheme;
class H264Parser;
struct H264SPS;
class OffsetByteQueue;
@@ -70,7 +70,8 @@ class MEDIA_EXPORT EsParserH264 : public EsParser {
// Update the video decoder config based on an H264 SPS.
// Return true if successful.
- bool UpdateVideoDecoderConfig(const H264SPS* sps);
+ bool UpdateVideoDecoderConfig(const H264SPS* sps,
+ const EncryptionScheme& scheme);
EsAdapterVideo es_adapter_;
diff --git a/media/formats/mp2t/es_parser_mpeg1audio.cc b/media/formats/mp2t/es_parser_mpeg1audio.cc
index 5032887..96ed8d6 100644
--- a/media/formats/mp2t/es_parser_mpeg1audio.cc
+++ b/media/formats/mp2t/es_parser_mpeg1audio.cc
@@ -12,6 +12,7 @@
#include "media/base/audio_timestamp_helper.h"
#include "media/base/bit_reader.h"
#include "media/base/channel_layout.h"
+#include "media/base/media_util.h"
#include "media/base/stream_parser_buffer.h"
#include "media/base/timestamp_constants.h"
#include "media/formats/common/offset_byte_queue.h"
@@ -170,12 +171,8 @@ bool EsParserMpeg1Audio::UpdateAudioConfiguration(
// TODO(damienv): Verify whether Android playback requires the extra data
// field for Mpeg1 audio. If yes, we should generate this field.
AudioDecoderConfig audio_decoder_config(
- kCodecMP3,
- kSampleFormatS16,
- header.channel_layout,
- header.sample_rate,
- std::vector<uint8_t>(),
- false);
+ kCodecMP3, kSampleFormatS16, header.channel_layout, header.sample_rate,
+ EmptyExtraData(), Unencrypted());
if (!audio_decoder_config.Matches(last_audio_decoder_config_)) {
DVLOG(1) << "Sampling frequency: " << header.sample_rate;