| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "services/media/framework_mojo/mojo_formatting.h" | 5 #include "services/media/framework_mojo/mojo_formatting.h" |
| 6 | 6 |
| 7 namespace mojo { | 7 namespace mojo { |
| 8 namespace media { | 8 namespace media { |
| 9 | 9 |
| 10 template <typename T> | 10 template <typename T> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 std::ostream& operator<<(std::ostream& os, const MediaTypePtr& value) { | 35 std::ostream& operator<<(std::ostream& os, const MediaTypePtr& value) { |
| 36 if (!value) { | 36 if (!value) { |
| 37 return os << "<nullptr>" << std::endl; | 37 return os << "<nullptr>" << std::endl; |
| 38 } else { | 38 } else { |
| 39 os << std::endl; | 39 os << std::endl; |
| 40 } | 40 } |
| 41 | 41 |
| 42 os << indent; | 42 os << indent; |
| 43 os << begl | 43 os << begl |
| 44 << "MediaTypeScheme scheme: " << StringFromMediaTypeScheme(value->scheme) | 44 << "MediaTypeMedium medium: " << StringFromMediaTypeMedium(value->medium) |
| 45 << std::endl; | 45 << std::endl; |
| 46 os << begl << "MediaTypeDetailsPtr details: " << value->details; | 46 os << begl << "MediaTypeDetailsPtr details: " << value->details; |
| 47 os << begl << "string encoding: " << value->encoding << std::endl; |
| 48 if (value->encoding_parameters) { |
| 49 os << begl << "array<uint8>? encoding_parameters: " |
| 50 << value->encoding_parameters.size() << " bytes" << std::endl; |
| 51 } else { |
| 52 os << begl << "array<uint8>? encoding_parameters: <nullptr>" << std::endl; |
| 53 } |
| 47 return os << outdent; | 54 return os << outdent; |
| 48 } | 55 } |
| 49 | 56 |
| 50 std::ostream& operator<<(std::ostream& os, const MediaTypeSetPtr& value) { | 57 std::ostream& operator<<(std::ostream& os, const MediaTypeSetPtr& value) { |
| 51 if (!value) { | 58 if (!value) { |
| 52 return os << "<nullptr>" << std::endl; | 59 return os << "<nullptr>" << std::endl; |
| 53 } else { | 60 } else { |
| 54 os << std::endl; | 61 os << std::endl; |
| 55 } | 62 } |
| 56 | 63 |
| 57 os << indent; | 64 os << indent; |
| 58 os << begl | 65 os << begl |
| 59 << "MediaTypeScheme scheme: " << StringFromMediaTypeScheme(value->scheme) | 66 << "MediaTypeMedium medium: " << StringFromMediaTypeMedium(value->medium) |
| 60 << std::endl; | 67 << std::endl; |
| 61 os << begl << "MediaTypeSetDetailsPtr details: " << value->details; | 68 os << begl << "MediaTypeSetDetailsPtr details: " << value->details; |
| 69 os << begl << "array<string> encodings: " << value->encodings; |
| 62 return os << outdent; | 70 return os << outdent; |
| 63 } | 71 } |
| 64 | 72 |
| 65 std::ostream& operator<<(std::ostream& os, const MediaTypeDetailsPtr& value) { | 73 std::ostream& operator<<(std::ostream& os, const MediaTypeDetailsPtr& value) { |
| 66 if (!value) { | 74 if (!value) { |
| 67 return os << "<nullptr>" << std::endl; | 75 return os << "<nullptr>" << std::endl; |
| 68 } else if (value->has_unknown_tag()) { | 76 } else if (value->has_unknown_tag()) { |
| 69 return os << "<empty>" << std::endl; | 77 return os << "<empty>" << std::endl; |
| 70 } else { | 78 } else { |
| 71 os << std::endl; | 79 os << std::endl; |
| 72 } | 80 } |
| 73 | 81 |
| 74 os << indent; | 82 os << indent; |
| 75 if (value->is_multiplexed()) { | 83 if (value->is_audio()) { |
| 76 return os << begl << "MultiplexedMediaTypeDetailsPtr* multiplexed: " | 84 return os << begl |
| 77 << value->get_multiplexed() << outdent; | 85 << "AudioMediaTypeDetailsPtr* audio: " << value->get_audio() |
| 78 } | |
| 79 if (value->is_lpcm()) { | |
| 80 return os << begl << "LpcmMediaTypeDetailsPtr* lpcm: " << value->get_lpcm() | |
| 81 << outdent; | 86 << outdent; |
| 82 } | 87 } |
| 83 if (value->is_compressed_audio()) { | |
| 84 return os << begl | |
| 85 << "CompressedAudiomMediaTypeDetailsPtr* compressed_audio: " | |
| 86 << value->get_compressed_audio() << outdent; | |
| 87 } | |
| 88 if (value->is_video()) { | 88 if (value->is_video()) { |
| 89 return os << begl | 89 return os << begl |
| 90 << "VideoMediaTypeDetailsPtr* video: " << value->get_video() | 90 << "VideoMediaTypeDetailsPtr* video: " << value->get_video() |
| 91 << outdent; | 91 << outdent; |
| 92 } | 92 } |
| 93 if (value->is_text()) { |
| 94 return os << begl << "TextMediaTypeDetailsPtr* text: " << value->get_text() |
| 95 << outdent; |
| 96 } |
| 97 if (value->is_subpicture()) { |
| 98 return os << begl << "SubpictureMediaTypeDetailsPtr* video: " |
| 99 << value->get_subpicture() << outdent; |
| 100 } |
| 93 return os << begl << "UNKNOWN TAG" << std::endl << outdent; | 101 return os << begl << "UNKNOWN TAG" << std::endl << outdent; |
| 94 } | 102 } |
| 95 | 103 |
| 96 std::ostream& operator<<(std::ostream& os, | 104 std::ostream& operator<<(std::ostream& os, |
| 97 const MediaTypeSetDetailsPtr& value) { | 105 const MediaTypeSetDetailsPtr& value) { |
| 98 if (!value) { | 106 if (!value) { |
| 99 return os << "<nullptr>" << std::endl; | 107 return os << "<nullptr>" << std::endl; |
| 100 } else if (value->has_unknown_tag()) { | 108 } else if (value->has_unknown_tag()) { |
| 101 return os << "<empty>" << std::endl; | 109 return os << "<empty>" << std::endl; |
| 102 } else { | 110 } else { |
| 103 os << std::endl; | 111 os << std::endl; |
| 104 } | 112 } |
| 105 | 113 |
| 106 os << indent; | 114 os << indent; |
| 107 if (value->is_multiplexed()) { | 115 if (value->is_audio()) { |
| 108 return os << begl << "MultiplexedMediaTypeSetDetailsPtr* multiplexed: " | |
| 109 << value->get_multiplexed() << outdent; | |
| 110 } | |
| 111 if (value->is_lpcm()) { | |
| 112 return os << begl | 116 return os << begl |
| 113 << "LpcmMediaTypeSetDetailsPtr* lpcm: " << value->get_lpcm() | 117 << "AudioMediaTypeSetDetailsPtr* audio: " << value->get_audio() |
| 114 << outdent; | 118 << outdent; |
| 115 } | 119 } |
| 116 if (value->is_compressed_audio()) { | |
| 117 return os << begl | |
| 118 << "CompressedAudioMediaTypeSetDetailsPtr* compressed_audio: " | |
| 119 << value->get_compressed_audio() << outdent; | |
| 120 } | |
| 121 if (value->is_video()) { | 120 if (value->is_video()) { |
| 122 return os << begl | 121 return os << begl |
| 123 << "VideoMediaTypeSetDetailsPtr* video: " << value->get_video() | 122 << "VideoMediaTypeSetDetailsPtr* video: " << value->get_video() |
| 124 << outdent; | 123 << outdent; |
| 125 } | 124 } |
| 125 if (value->is_text()) { |
| 126 return os << begl |
| 127 << "TextMediaTypeSetDetailsPtr* video: " << value->get_text() |
| 128 << outdent; |
| 129 } |
| 130 if (value->is_subpicture()) { |
| 131 return os << begl << "SubpictureMediaTypeSetDetailsPtr* video: " |
| 132 << value->get_subpicture() << outdent; |
| 133 } |
| 126 return os << begl << "UNKNOWN TAG" << std::endl << outdent; | 134 return os << begl << "UNKNOWN TAG" << std::endl << outdent; |
| 127 } | 135 } |
| 128 | 136 |
| 129 std::ostream& operator<<(std::ostream& os, | 137 std::ostream& operator<<(std::ostream& os, |
| 130 const MultiplexedMediaTypeDetailsPtr& value) { | 138 const AudioMediaTypeDetailsPtr& value) { |
| 131 if (!value) { | 139 if (!value) { |
| 132 return os << "<nullptr>" << std::endl; | 140 return os << "<nullptr>" << std::endl; |
| 133 } else { | 141 } else { |
| 134 os << std::endl; | 142 os << std::endl; |
| 135 } | 143 } |
| 136 | 144 |
| 137 os << indent; | 145 os << indent; |
| 138 os << begl << "MediaTypePtr multiplex_type: " << value->multiplex_type; | 146 os << begl << "AudioSampleFormat sample_format: " |
| 139 os << begl | 147 << StringFromAudioSampleFormat(value->sample_format) << std::endl; |
| 140 << "Array<MediaTypePtr> substream_types: " << value->substream_types; | 148 os << begl << "uint32_t channels: " << int(value->channels) << std::endl; |
| 149 os << begl << "uint32_t frames_per_second: " << value->frames_per_second |
| 150 << std::endl; |
| 141 return os << outdent; | 151 return os << outdent; |
| 142 } | 152 } |
| 143 | 153 |
| 144 std::ostream& operator<<(std::ostream& os, | 154 std::ostream& operator<<(std::ostream& os, |
| 145 const MultiplexedMediaTypeSetDetailsPtr& value) { | 155 const AudioMediaTypeSetDetailsPtr& value) { |
| 146 if (!value) { | 156 if (!value) { |
| 147 return os << "<nullptr>" << std::endl; | 157 return os << "<nullptr>" << std::endl; |
| 148 } else { | 158 } else { |
| 149 os << std::endl; | 159 os << std::endl; |
| 150 } | 160 } |
| 151 | 161 |
| 152 os << indent; | 162 os << indent; |
| 163 os << begl << "AudioSampleFormat sample_format: " |
| 164 << StringFromAudioSampleFormat(value->sample_format) << std::endl; |
| 165 os << begl << "uint32_t min_channels: " << int(value->min_channels) |
| 166 << std::endl; |
| 167 os << begl << "uint32_t max_channels: " << int(value->max_channels) |
| 168 << std::endl; |
| 153 os << begl | 169 os << begl |
| 154 << "MediaTypeSetPtr multiplex_type_set: " << value->multiplex_type_set; | 170 << "uint32_t min_frames_per_second: " << value->min_frames_per_second |
| 155 os << begl << "Array<MediaTypeSetPtr> substream_type_sets: " | 171 << std::endl; |
| 156 << value->substream_type_sets; | 172 os << begl |
| 173 << "uint32_t max_cframes_per_second: " << value->max_frames_per_second |
| 174 << std::endl; |
| 157 return os << outdent; | 175 return os << outdent; |
| 158 } | 176 } |
| 159 | 177 |
| 160 std::ostream& operator<<(std::ostream& os, | 178 std::ostream& operator<<(std::ostream& os, |
| 161 const LpcmMediaTypeDetailsPtr& value) { | 179 const VideoMediaTypeDetailsPtr& value) { |
| 162 if (!value) { | 180 if (!value) { |
| 163 return os << "<nullptr>" << std::endl; | 181 return os << "<nullptr>" << std::endl; |
| 164 } else { | 182 } else { |
| 165 os << std::endl; | 183 os << std::endl; |
| 166 } | 184 } |
| 167 | 185 |
| 168 os << indent; | 186 os << indent; |
| 169 os << begl << "LpcmSampleFormat sample_format: " | 187 os << begl << "VideoProfile profile: " << value->profile << std::endl; |
| 170 << StringFromLpcmSampleFormat(value->sample_format) << std::endl; | 188 os << begl << "PixelFormat pixel_format: " << value->pixel_format |
| 171 os << begl << "uint32_t channels: " << int(value->channels) << std::endl; | |
| 172 os << begl << "uint32_t frames_per_second: " << value->frames_per_second | |
| 173 << std::endl; | 189 << std::endl; |
| 190 os << begl << "ColorSpace color_space: " << value->color_space << std::endl; |
| 191 os << begl << "uint32_t width: " << value->width << std::endl; |
| 192 os << begl << "uint32_t height: " << value->height << std::endl; |
| 193 os << begl << "uint32_t coded_width: " << value->coded_width << std::endl; |
| 194 os << begl << "uint32_t coded_height: " << value->coded_height << std::endl; |
| 174 return os << outdent; | 195 return os << outdent; |
| 175 } | 196 } |
| 176 | 197 |
| 177 std::ostream& operator<<(std::ostream& os, | 198 std::ostream& operator<<(std::ostream& os, |
| 178 const LpcmMediaTypeSetDetailsPtr& value) { | 199 const VideoMediaTypeSetDetailsPtr& value) { |
| 179 if (!value) { | 200 if (!value) { |
| 180 return os << "<nullptr>" << std::endl; | 201 return os << "<nullptr>" << std::endl; |
| 181 } else { | 202 } else { |
| 182 os << std::endl; | 203 os << std::endl; |
| 183 } | 204 } |
| 184 | 205 |
| 185 os << indent; | 206 os << indent; |
| 186 os << begl << "LpcmSampleFormat sample_format: " | 207 os << begl << "uint32_t min_width: " << value->min_width << std::endl; |
| 187 << StringFromLpcmSampleFormat(value->sample_format) << std::endl; | 208 os << begl << "uint32_t max_width: " << value->max_width << std::endl; |
| 188 os << begl << "uint32_t min_channels: " << int(value->min_channels) | 209 os << begl << "uint32_t min_height: " << value->min_height << std::endl; |
| 189 << std::endl; | 210 os << begl << "uint32_t max_height: " << value->max_height << std::endl; |
| 190 os << begl << "uint32_t max_channels: " << int(value->max_channels) | |
| 191 << std::endl; | |
| 192 os << begl | |
| 193 << "uint32_t min_frames_per_second: " << value->min_frames_per_second | |
| 194 << std::endl; | |
| 195 os << begl | |
| 196 << "uint32_t max_cframes_per_second: " << value->max_frames_per_second | |
| 197 << std::endl; | |
| 198 return os << outdent; | 211 return os << outdent; |
| 199 } | 212 } |
| 200 | 213 |
| 201 std::ostream& operator<<(std::ostream& os, | 214 std::ostream& operator<<(std::ostream& os, |
| 202 const CompressedAudioMediaTypeDetailsPtr& value) { | 215 const TextMediaTypeDetailsPtr& value) { |
| 203 if (!value) { | 216 if (!value) { |
| 204 return os << "<nullptr>" << std::endl; | 217 return os << "<nullptr>" << std::endl; |
| 205 } else { | 218 } else { |
| 206 os << std::endl; | 219 os << std::endl; |
| 207 } | 220 } |
| 208 | 221 |
| 209 os << indent; | 222 os << indent; |
| 210 os << begl | |
| 211 << "AudioEncoding encoding: " << StringFromAudioEncoding(value->encoding) | |
| 212 << std::endl; | |
| 213 os << begl << "LpcmSampleFormat sample_format: " | |
| 214 << StringFromLpcmSampleFormat(value->sample_format) << std::endl; | |
| 215 os << begl << "uint32_t channels: " << int(value->channels) << std::endl; | |
| 216 os << begl << "uint32_t frames_per_second: " << value->frames_per_second | |
| 217 << std::endl; | |
| 218 return os << outdent; | 223 return os << outdent; |
| 219 } | 224 } |
| 220 | 225 |
| 221 std::ostream& operator<<(std::ostream& os, | 226 std::ostream& operator<<(std::ostream& os, |
| 222 const CompressedAudioMediaTypeSetDetailsPtr& value) { | 227 const TextMediaTypeSetDetailsPtr& value) { |
| 223 if (!value) { | 228 if (!value) { |
| 224 return os << "<nullptr>" << std::endl; | 229 return os << "<nullptr>" << std::endl; |
| 225 } else { | 230 } else { |
| 226 os << std::endl; | 231 os << std::endl; |
| 227 } | 232 } |
| 228 | 233 |
| 229 os << indent; | 234 os << indent; |
| 230 os << begl | |
| 231 << "AudioEncoding encoding: " << StringFromAudioEncoding(value->encoding) | |
| 232 << std::endl; | |
| 233 os << begl << "LpcmSampleFormat sample_format: " | |
| 234 << StringFromLpcmSampleFormat(value->sample_format) << std::endl; | |
| 235 os << begl << "uint32_t min_channels: " << int(value->min_channels) | |
| 236 << std::endl; | |
| 237 os << begl << "uint32_t max_channels: " << int(value->max_channels) | |
| 238 << std::endl; | |
| 239 os << begl | |
| 240 << "uint32_t min_frames_per_second: " << value->min_frames_per_second | |
| 241 << std::endl; | |
| 242 os << begl | |
| 243 << "uint32_t max_cframes_per_second: " << value->max_frames_per_second | |
| 244 << std::endl; | |
| 245 return os << outdent; | 235 return os << outdent; |
| 246 } | 236 } |
| 247 | 237 |
| 248 std::ostream& operator<<(std::ostream& os, | 238 std::ostream& operator<<(std::ostream& os, |
| 249 const VideoMediaTypeDetailsPtr& value) { | 239 const SubpictureMediaTypeDetailsPtr& value) { |
| 250 if (!value) { | 240 if (!value) { |
| 251 return os << "<nullptr>" << std::endl; | 241 return os << "<nullptr>" << std::endl; |
| 252 } else { | 242 } else { |
| 253 os << std::endl; | 243 os << std::endl; |
| 254 } | 244 } |
| 255 | 245 |
| 256 os << indent; | 246 os << indent; |
| 257 os << begl | |
| 258 << "VideoEncoding encoding: " << StringFromVideoEncoding(value->encoding) | |
| 259 << std::endl; | |
| 260 os << begl << "VideoProfile profile: " << value->profile << std::endl; | |
| 261 os << begl << "PixelFormat pixel_format: " << value->pixel_format | |
| 262 << std::endl; | |
| 263 os << begl << "ColorSpace color_space: " << value->color_space << std::endl; | |
| 264 os << begl << "uint32_t width: " << value->width << std::endl; | |
| 265 os << begl << "uint32_t height: " << value->height << std::endl; | |
| 266 os << begl << "uint32_t coded_width: " << value->coded_width << std::endl; | |
| 267 os << begl << "uint32_t coded_height: " << value->coded_height << std::endl; | |
| 268 return os << outdent; | 247 return os << outdent; |
| 269 } | 248 } |
| 270 | 249 |
| 271 std::ostream& operator<<(std::ostream& os, | 250 std::ostream& operator<<(std::ostream& os, |
| 272 const VideoMediaTypeSetDetailsPtr& value) { | 251 const SubpictureMediaTypeSetDetailsPtr& value) { |
| 273 if (!value) { | 252 if (!value) { |
| 274 return os << "<nullptr>" << std::endl; | 253 return os << "<nullptr>" << std::endl; |
| 275 } else { | 254 } else { |
| 276 os << std::endl; | 255 os << std::endl; |
| 277 } | 256 } |
| 278 | 257 |
| 279 os << indent; | 258 os << indent; |
| 280 os << begl | |
| 281 << "VideoEncoding encoding: " << StringFromVideoEncoding(value->encoding) | |
| 282 << std::endl; | |
| 283 os << begl << "uint32_t min_width: " << value->min_width << std::endl; | |
| 284 os << begl << "uint32_t max_width: " << value->max_width << std::endl; | |
| 285 os << begl << "uint32_t min_height: " << value->min_height << std::endl; | |
| 286 os << begl << "uint32_t max_height: " << value->max_height << std::endl; | |
| 287 return os << outdent; | 259 return os << outdent; |
| 288 } | 260 } |
| 289 | 261 |
| 290 std::ostream& operator<<(std::ostream& os, const TimelineQuadPtr& value) { | 262 std::ostream& operator<<(std::ostream& os, const TimelineQuadPtr& value) { |
| 291 if (!value) { | 263 if (!value) { |
| 292 return os << "<nullptr>" << std::endl; | 264 return os << "<nullptr>" << std::endl; |
| 293 } else { | 265 } else { |
| 294 os << std::endl; | 266 os << std::endl; |
| 295 } | 267 } |
| 296 | 268 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 | 363 |
| 392 std::ostream& operator<<(std::ostream& os, | 364 std::ostream& operator<<(std::ostream& os, |
| 393 const ScopedDataPipeConsumerHandle& value) { | 365 const ScopedDataPipeConsumerHandle& value) { |
| 394 if (value.is_valid()) { | 366 if (value.is_valid()) { |
| 395 return os << "<valid>"; | 367 return os << "<valid>"; |
| 396 } else { | 368 } else { |
| 397 return os << "<not valid>"; | 369 return os << "<not valid>"; |
| 398 } | 370 } |
| 399 } | 371 } |
| 400 | 372 |
| 401 const char* StringFromMediaTypeScheme(MediaTypeScheme value) { | 373 const char* StringFromMediaTypeMedium(MediaTypeMedium value) { |
| 402 switch (value) { | 374 switch (value) { |
| 403 case MediaTypeScheme::UNKNOWN: | 375 case MediaTypeMedium::AUDIO: |
| 404 return "UNKNOWN"; | 376 return "AUDIO"; |
| 405 case MediaTypeScheme::NONE: | 377 case MediaTypeMedium::VIDEO: |
| 406 return "NONE"; | |
| 407 case MediaTypeScheme::ANY_ELEMENTARY: | |
| 408 return "ANY_ELEMENTARY"; | |
| 409 case MediaTypeScheme::ANY_AUDIO: | |
| 410 return "ANY_AUDIO"; | |
| 411 case MediaTypeScheme::ANY_VIDEO: | |
| 412 return "ANY_VIDEO"; | |
| 413 case MediaTypeScheme::ANY_TEXT: | |
| 414 return "ANY_TEXT"; | |
| 415 case MediaTypeScheme::ANY_SUBPICTURE: | |
| 416 return "ANY_SUBPICTURE"; | |
| 417 case MediaTypeScheme::ANY_MULTIPLEXED: | |
| 418 return "ANY_MULTIPLEXED"; | |
| 419 case MediaTypeScheme::MULTIPLEXED: | |
| 420 return "MULTIPLEXED"; | |
| 421 case MediaTypeScheme::ANY: | |
| 422 return "ANY"; | |
| 423 case MediaTypeScheme::LPCM: | |
| 424 return "LPCM"; | |
| 425 case MediaTypeScheme::COMPRESSED_AUDIO: | |
| 426 return "COMPRESSED_AUDIO"; | |
| 427 case MediaTypeScheme::VIDEO: | |
| 428 return "VIDEO"; | 378 return "VIDEO"; |
| 379 case MediaTypeMedium::TEXT: |
| 380 return "TEXT"; |
| 381 case MediaTypeMedium::SUBPICTURE: |
| 382 return "SUBPICTURE"; |
| 429 } | 383 } |
| 430 return "UNKNOWN SCHEME"; | 384 return "UNKNOWN MEDIUM"; |
| 431 } | 385 } |
| 432 | 386 |
| 433 const char* StringFromLpcmSampleFormat(LpcmSampleFormat value) { | 387 const char* StringFromAudioSampleFormat(AudioSampleFormat value) { |
| 434 switch (value) { | 388 switch (value) { |
| 435 case LpcmSampleFormat::UNKNOWN: | 389 case AudioSampleFormat::ANY: |
| 436 return "UNKNOWN"; | |
| 437 case LpcmSampleFormat::ANY: | |
| 438 return "ANY"; | 390 return "ANY"; |
| 439 case LpcmSampleFormat::UNSIGNED_8: | 391 case AudioSampleFormat::UNSIGNED_8: |
| 440 return "UNSIGNED_8"; | 392 return "UNSIGNED_8"; |
| 441 case LpcmSampleFormat::SIGNED_16: | 393 case AudioSampleFormat::SIGNED_16: |
| 442 return "SIGNED_16"; | 394 return "SIGNED_16"; |
| 443 case LpcmSampleFormat::SIGNED_24_IN_32: | 395 case AudioSampleFormat::SIGNED_24_IN_32: |
| 444 return "SIGNED_24_IN_32"; | 396 return "SIGNED_24_IN_32"; |
| 445 case LpcmSampleFormat::FLOAT: | 397 case AudioSampleFormat::FLOAT: |
| 446 return "FLOAT"; | 398 return "FLOAT"; |
| 447 } | 399 } |
| 448 return "UNKNOWN FORMAT"; | 400 return "UNKNOWN FORMAT"; |
| 449 } | 401 } |
| 450 | 402 |
| 451 const char* StringFromAudioEncoding(AudioEncoding value) { | |
| 452 switch (value) { | |
| 453 case AudioEncoding::UNKNOWN: | |
| 454 return "UNKNOWN"; | |
| 455 case AudioEncoding::ANY: | |
| 456 return "ANY"; | |
| 457 case AudioEncoding::VORBIS: | |
| 458 return "VORBIS"; | |
| 459 } | |
| 460 return "UNKNOWN AUDIO ENCODING"; | |
| 461 } | |
| 462 | |
| 463 const char* StringFromVideoEncoding(VideoEncoding value) { | |
| 464 switch (value) { | |
| 465 case VideoEncoding::UNKNOWN: | |
| 466 return "UNKNOWN"; | |
| 467 case VideoEncoding::ANY: | |
| 468 return "ANY"; | |
| 469 case VideoEncoding::THEORA: | |
| 470 return "THEORA"; | |
| 471 case VideoEncoding::VP8: | |
| 472 return "VP8"; | |
| 473 } | |
| 474 return "UNKNOWN VIDEO ENCODING"; | |
| 475 } | |
| 476 | |
| 477 const char* StringFromMediaState(MediaState value) { | 403 const char* StringFromMediaState(MediaState value) { |
| 478 switch (value) { | 404 switch (value) { |
| 479 case MediaState::FAULT: | 405 case MediaState::FAULT: |
| 480 return "FAULT"; | 406 return "FAULT"; |
| 481 case MediaState::UNPREPARED: | 407 case MediaState::UNPREPARED: |
| 482 return "UNPREPARED"; | 408 return "UNPREPARED"; |
| 483 case MediaState::PAUSED: | 409 case MediaState::PAUSED: |
| 484 return "PAUSED"; | 410 return "PAUSED"; |
| 485 case MediaState::PLAYING: | 411 case MediaState::PLAYING: |
| 486 return "PLAYING"; | 412 return "PLAYING"; |
| 487 case MediaState::ENDED: | 413 case MediaState::ENDED: |
| 488 return "ENDED"; | 414 return "ENDED"; |
| 489 } | 415 } |
| 490 return "UNKNOWN MEDIA STATE"; | 416 return "UNKNOWN MEDIA STATE"; |
| 491 } | 417 } |
| 492 | 418 |
| 493 } // namespace media | 419 } // namespace media |
| 494 } // namespace mojo | 420 } // namespace mojo |
| OLD | NEW |