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

Side by Side Diff: media/base/android/demuxer_stream_player_params.cc

Issue 1469353010: Configure MediaCodec with CDM in ADVA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase again Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « media/base/BUILD.gn ('k') | media/base/audio_decoder_config.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/base/android/demuxer_stream_player_params.h" 5 #include "media/base/android/demuxer_stream_player_params.h"
6 #include <iomanip> 6 #include <iomanip>
7 7
8 namespace media { 8 namespace media {
9 9
10 DemuxerConfigs::DemuxerConfigs() 10 DemuxerConfigs::DemuxerConfigs()
(...skipping 28 matching lines...) Expand all
39 return "VIDEO"; 39 return "VIDEO";
40 case DemuxerStream::TEXT: 40 case DemuxerStream::TEXT:
41 return "TEXT"; 41 return "TEXT";
42 case DemuxerStream::NUM_TYPES: 42 case DemuxerStream::NUM_TYPES:
43 return "NUM_TYPES"; 43 return "NUM_TYPES";
44 } 44 }
45 NOTREACHED(); 45 NOTREACHED();
46 return nullptr; // crash early 46 return nullptr; // crash early
47 } 47 }
48 48
49 #undef RETURN_STRING
50 #define RETURN_STRING(x) \
51 case x: \
52 return #x;
53
54 const char* AsString(AudioCodec codec) {
55 switch (codec) {
56 RETURN_STRING(kUnknownAudioCodec);
57 RETURN_STRING(kCodecAAC);
58 RETURN_STRING(kCodecMP3);
59 RETURN_STRING(kCodecPCM);
60 RETURN_STRING(kCodecVorbis);
61 RETURN_STRING(kCodecFLAC);
62 RETURN_STRING(kCodecAMR_NB);
63 RETURN_STRING(kCodecAMR_WB);
64 RETURN_STRING(kCodecPCM_MULAW);
65 RETURN_STRING(kCodecGSM_MS);
66 RETURN_STRING(kCodecPCM_S16BE);
67 RETURN_STRING(kCodecPCM_S24BE);
68 RETURN_STRING(kCodecOpus);
69 RETURN_STRING(kCodecEAC3);
70 RETURN_STRING(kCodecPCM_ALAW);
71 RETURN_STRING(kCodecALAC);
72 RETURN_STRING(kCodecAC3);
73 }
74 NOTREACHED();
75 return nullptr; // crash early
76 }
77
78 const char* AsString(VideoCodec codec) {
79 switch (codec) {
80 RETURN_STRING(kUnknownVideoCodec);
81 RETURN_STRING(kCodecH264);
82 RETURN_STRING(kCodecHEVC);
83 RETURN_STRING(kCodecVC1);
84 RETURN_STRING(kCodecMPEG2);
85 RETURN_STRING(kCodecMPEG4);
86 RETURN_STRING(kCodecTheora);
87 RETURN_STRING(kCodecVP8);
88 RETURN_STRING(kCodecVP9);
89 }
90 NOTREACHED();
91 return nullptr; // crash early
92 }
93
94 const char* AsString(DemuxerStream::Status status) { 49 const char* AsString(DemuxerStream::Status status) {
95 switch (status) { 50 switch (status) {
96 case DemuxerStream::kOk: 51 case DemuxerStream::kOk:
97 return "kOk"; 52 return "kOk";
98 case DemuxerStream::kAborted: 53 case DemuxerStream::kAborted:
99 return "kAborted"; 54 return "kAborted";
100 case DemuxerStream::kConfigChanged: 55 case DemuxerStream::kConfigChanged:
101 return "kConfigChanged"; 56 return "kConfigChanged";
102 } 57 }
103 NOTREACHED(); 58 NOTREACHED();
104 return nullptr; // crash early 59 return nullptr; // crash early
105 } 60 }
106 61
107 #undef RETURN_STRING
108
109 } // namespace (anonymous) 62 } // namespace (anonymous)
110 63
111 } // namespace media 64 } // namespace media
112 65
113 std::ostream& operator<<(std::ostream& os, media::DemuxerStream::Type type) { 66 std::ostream& operator<<(std::ostream& os, media::DemuxerStream::Type type) {
114 os << media::AsString(type); 67 os << media::AsString(type);
115 return os; 68 return os;
116 } 69 }
117 70
118 std::ostream& operator<<(std::ostream& os, const media::AccessUnit& au) { 71 std::ostream& operator<<(std::ostream& os, const media::AccessUnit& au) {
119 os << "status:" << media::AsString(au.status) 72 os << "status:" << media::AsString(au.status)
120 << (au.is_end_of_stream ? " EOS" : "") 73 << (au.is_end_of_stream ? " EOS" : "")
121 << (au.is_key_frame ? " KEY_FRAME" : "") << " pts:" << au.timestamp 74 << (au.is_key_frame ? " KEY_FRAME" : "") << " pts:" << au.timestamp
122 << " size:" << au.data.size(); 75 << " size:" << au.data.size();
123 return os; 76 return os;
124 } 77 }
125 78
126 std::ostream& operator<<(std::ostream& os, const media::DemuxerConfigs& conf) { 79 std::ostream& operator<<(std::ostream& os, const media::DemuxerConfigs& conf) {
127 os << "duration:" << conf.duration; 80 os << "duration:" << conf.duration;
128 81
129 if (conf.audio_codec == media::kUnknownAudioCodec && 82 if (conf.audio_codec == media::kUnknownAudioCodec &&
130 conf.video_codec == media::kUnknownVideoCodec) { 83 conf.video_codec == media::kUnknownVideoCodec) {
131 os << " no audio, no video"; 84 os << " no audio, no video";
132 return os; 85 return os;
133 } 86 }
134 87
135 if (conf.audio_codec != media::kUnknownAudioCodec) { 88 if (conf.audio_codec != media::kUnknownAudioCodec) {
136 os << " audio:" << media::AsString(conf.audio_codec) 89 os << " audio:" << media::GetCodecName(conf.audio_codec)
137 << " channels:" << conf.audio_channels 90 << " channels:" << conf.audio_channels
138 << " rate:" << conf.audio_sampling_rate 91 << " rate:" << conf.audio_sampling_rate
139 << (conf.is_audio_encrypted ? " encrypted" : "") 92 << (conf.is_audio_encrypted ? " encrypted" : "")
140 << " delay (ns):" << conf.audio_codec_delay_ns 93 << " delay (ns):" << conf.audio_codec_delay_ns
141 << " preroll (ns):" << conf.audio_seek_preroll_ns; 94 << " preroll (ns):" << conf.audio_seek_preroll_ns;
142 95
143 if (!conf.audio_extra_data.empty()) { 96 if (!conf.audio_extra_data.empty()) {
144 os << " extra:{" << std::hex; 97 os << " extra:{" << std::hex;
145 for (uint8_t byte : conf.audio_extra_data) 98 for (uint8_t byte : conf.audio_extra_data)
146 os << " " << std::setfill('0') << std::setw(2) << (int)byte; 99 os << " " << std::setfill('0') << std::setw(2) << (int)byte;
147 os << "}" << std::dec; 100 os << "}" << std::dec;
148 } 101 }
149 } 102 }
150 103
151 if (conf.video_codec != media::kUnknownVideoCodec) { 104 if (conf.video_codec != media::kUnknownVideoCodec) {
152 os << " video:" << media::AsString(conf.video_codec) << " " 105 os << " video:" << media::GetCodecName(conf.video_codec) << " "
153 << conf.video_size.width() << "x" << conf.video_size.height() 106 << conf.video_size.width() << "x" << conf.video_size.height()
154 << (conf.is_video_encrypted ? " encrypted" : ""); 107 << (conf.is_video_encrypted ? " encrypted" : "");
155 } 108 }
156 109
157 return os; 110 return os;
158 } 111 }
OLDNEW
« no previous file with comments | « media/base/BUILD.gn ('k') | media/base/audio_decoder_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698