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

Unified Diff: chromecast/common/media/cma_param_traits.cc

Issue 2058113002: Add 'cbcs' encryption scheme support in Android media. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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: chromecast/common/media/cma_param_traits.cc
diff --git a/chromecast/common/media/cma_param_traits.cc b/chromecast/common/media/cma_param_traits.cc
index 9ae9fb70a45f494449e45544f570a297a6eef60e..39afb36e7fdfb757299729c8da417431fab1f428 100644
--- a/chromecast/common/media/cma_param_traits.cc
+++ b/chromecast/common/media/cma_param_traits.cc
@@ -12,37 +12,22 @@
#include "content/public/common/common_param_traits.h"
#include "ipc/ipc_message_macros.h"
#include "media/base/audio_decoder_config.h"
-#include "media/base/encryption_scheme.h"
+#include "media/base/ipc/media_param_traits.h"
#include "media/base/video_decoder_config.h"
#include "ui/gfx/ipc/gfx_param_traits.h"
#include "ui/gfx/ipc/skia/gfx_skia_param_traits.h"
-// Note(slan): These are defined in the following headers:
+// Note(slan): This is defined in the following header:
// media/gpu/ipc/common/media_param_traits_macros.h
-// content/common/media/audio_messages.h
-// but including these headers is not correct, so forward declare them here.
-// Their existing implementations in content/ and media/ should be linked in.
+// but including this header is not correct, so forward declare them here.
+// The existing implementation in media/ should be linked in.
// This hack will not be necessary with Mojo.
-IPC_ENUM_TRAITS_MIN_MAX_VALUE(media::ChannelLayout,
- media::ChannelLayout::CHANNEL_LAYOUT_NONE,
- media::ChannelLayout::CHANNEL_LAYOUT_MAX)
IPC_ENUM_TRAITS_MIN_MAX_VALUE(media::VideoCodecProfile,
media::VIDEO_CODEC_PROFILE_MIN,
media::VIDEO_CODEC_PROFILE_MAX)
-IPC_ENUM_TRAITS_MAX_VALUE(media::VideoPixelFormat, media::PIXEL_FORMAT_MAX)
namespace IPC {
-template <>
-struct ParamTraits<media::EncryptionScheme::Pattern> {
- typedef media::EncryptionScheme::Pattern param_type;
- static void Write(base::Pickle* m, const param_type& p);
- static bool Read(const base::Pickle* m, base::PickleIterator* iter,
- param_type* r);
- static void Log(const param_type& p, std::string* l);
-};
-
-
void ParamTraits<media::AudioDecoderConfig>::Write(
base::Pickle* m,
const media::AudioDecoderConfig& p) {
@@ -126,45 +111,4 @@ void ParamTraits<media::VideoDecoderConfig>::Log(
l->append(base::StringPrintf("<VideoDecoderConfig>"));
}
-void ParamTraits<media::EncryptionScheme>::Write(
- base::Pickle* m, const param_type& p) {
- WriteParam(m, p.mode());
- WriteParam(m, p.pattern());
-}
-
-bool ParamTraits<media::EncryptionScheme>::Read(
- const base::Pickle* m, base::PickleIterator* iter, param_type* r) {
- media::EncryptionScheme::CipherMode mode;
- media::EncryptionScheme::Pattern pattern;
- if (!ReadParam(m, iter, &mode) || !ReadParam(m, iter, &pattern))
- return false;
- *r = media::EncryptionScheme(mode, pattern);
- return true;
-}
-
-void ParamTraits<media::EncryptionScheme>::Log(
- const param_type& p, std::string* l) {
- l->append(base::StringPrintf("<EncryptionScheme>"));
-}
-
-void ParamTraits<media::EncryptionScheme::Pattern>::Write(
- base::Pickle* m, const param_type& p) {
- WriteParam(m, p.encrypt_blocks());
- WriteParam(m, p.skip_blocks());
-}
-
-bool ParamTraits<media::EncryptionScheme::Pattern>::Read(
- const base::Pickle* m, base::PickleIterator* iter, param_type* r) {
- uint32_t encrypt_blocks, skip_blocks;
- if (!ReadParam(m, iter, &encrypt_blocks) || !ReadParam(m, iter, &skip_blocks))
- return false;
- *r = media::EncryptionScheme::Pattern(encrypt_blocks, skip_blocks);
- return true;
-}
-
-void ParamTraits<media::EncryptionScheme::Pattern>::Log(
- const param_type& p, std::string* l) {
- l->append(base::StringPrintf("<Pattern>"));
-}
-
} // namespace IPC

Powered by Google App Engine
This is Rietveld 408576698