Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(371)

Unified Diff: media/ffmpeg/ffmpeg_common.cc

Issue 1490613005: media config: expand is_encrypted to a struct. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ddorwin comments Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/ffmpeg/ffmpeg_common.cc
diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc
index 51e8884fedb1b35fab80b24e13abda6ae4c8f688..b2bf2c2ed35ffad884cd431232fabe39d4e1e8ad 100644
--- a/media/ffmpeg/ffmpeg_common.cc
+++ b/media/ffmpeg/ffmpeg_common.cc
@@ -13,6 +13,7 @@
#include "build/build_config.h"
#include "media/base/audio_decoder_config.h"
#include "media/base/decoder_buffer.h"
+#include "media/base/encryption_scheme.h"
#include "media/base/video_decoder_config.h"
#include "media/base/video_util.h"
#include "media/media_features.h"
@@ -371,13 +372,12 @@ bool AVCodecContextToAudioDecoderConfig(const AVCodecContext* codec_context,
extra_data.assign(codec_context->extradata,
codec_context->extradata + codec_context->extradata_size);
}
- config->Initialize(codec,
- sample_format,
- channel_layout,
- sample_rate,
- extra_data,
- is_encrypted,
- seek_preroll,
+
+ EncryptionScheme encryption_scheme(
ddorwin 2016/03/02 23:24:05 It's weird that the audio path has an extra functi
dougsteed 2016/03/03 04:45:00 Done. The extra audio function AVCodecContextToAud
ddorwin 2016/03/03 18:38:04 Yes. No interfaces are guaranteed not to change ex
+ is_encrypted ? EncryptionScheme::kCipherModeAesCtr
+ : EncryptionScheme::kCipherModeUnencrypted);
+ config->Initialize(codec, sample_format, channel_layout, sample_rate,
+ extra_data, encryption_scheme, seek_preroll,
codec_context->delay);
// Verify that AudioConfig.bits_per_channel was calculated correctly for
@@ -497,11 +497,11 @@ bool AVStreamToVideoDecoderConfig(const AVStream* stream,
coded_size.set_height((coded_size.height() + 1) / 2 * 2);
}
- bool is_encrypted = false;
AVDictionaryEntry* key =
av_dict_get(stream->metadata, "enc_key_id", nullptr, 0);
- if (key)
- is_encrypted = true;
+ EncryptionScheme encryption_scheme(
+ key ? EncryptionScheme::kCipherModeAesCtr
+ : EncryptionScheme::kCipherModeUnencrypted);
AVDictionaryEntry* webm_alpha =
av_dict_get(stream->metadata, "alpha_mode", nullptr, 0);
@@ -535,7 +535,7 @@ bool AVStreamToVideoDecoderConfig(const AVStream* stream,
stream->codec->extradata + stream->codec->extradata_size);
}
config->Initialize(codec, profile, format, color_space, coded_size,
- visible_rect, natural_size, extra_data, is_encrypted);
+ visible_rect, natural_size, extra_data, encryption_scheme);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698