| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef SERVICES_MEDIA_FRAMEWORK_MOJO_MOJO_FORMATTING_H_ |
| 6 #define SERVICES_MEDIA_FRAMEWORK_MOJO_MOJO_FORMATTING_H_ |
| 7 |
| 8 #include "mojo/services/media/common/interfaces/media_common.mojom.h" |
| 9 #include "mojo/services/media/common/interfaces/media_pipe.mojom.h" |
| 10 #include "mojo/services/media/common/interfaces/media_types.mojom.h" |
| 11 #include "mojo/services/media/control/interfaces/media_source.mojom.h" |
| 12 #include "services/media/framework/formatting.h" |
| 13 |
| 14 namespace mojo { |
| 15 namespace media { |
| 16 |
| 17 // See services/media/framework/ostream.h for details. |
| 18 |
| 19 // Mojo defines versions of operator<< for this that produce only numbers. |
| 20 const char* StringFromMediaTypeScheme(MediaTypeScheme value); |
| 21 const char* StringFromLpcmSampleFormat(LpcmSampleFormat value); |
| 22 const char* StringFromAudioEncoding(AudioEncoding value); |
| 23 const char* StringFromVideoEncoding(VideoEncoding value); |
| 24 const char* StringFromMediaState(MediaState value); |
| 25 |
| 26 // The following overloads add newlines. |
| 27 |
| 28 template<typename T> |
| 29 std::ostream& operator<<(std::ostream& os, const InterfacePtr<T>& value); |
| 30 |
| 31 template<typename T> |
| 32 std::ostream& operator<<(std::ostream& os, const Array<T>& value) { |
| 33 if (!value) { |
| 34 return os << "<nullptr>" << std::endl; |
| 35 } else if (value.size() == 0) { |
| 36 return os << "<empty>" << std::endl; |
| 37 } else { |
| 38 os << std::endl; |
| 39 } |
| 40 |
| 41 int index = 0; |
| 42 for (T& element : const_cast<Array<T>&>(value)) { |
| 43 os << "[" << index++ << "]: " << element; |
| 44 } |
| 45 |
| 46 return os; |
| 47 } |
| 48 |
| 49 std::ostream& operator<<(std::ostream& os, const MediaTypePtr& value); |
| 50 std::ostream& operator<<(std::ostream& os, const MediaTypeSetPtr& value); |
| 51 std::ostream& operator<<(std::ostream& os, const MediaTypeDetailsPtr& value); |
| 52 std::ostream& operator<<(std::ostream& os, const MediaTypeSetDetailsPtr& value); |
| 53 std::ostream& operator<<( |
| 54 std::ostream& os, |
| 55 const MultiplexedMediaTypeDetailsPtr& value); |
| 56 std::ostream& operator<<( |
| 57 std::ostream& os, |
| 58 const MultiplexedMediaTypeSetDetailsPtr& value); |
| 59 std::ostream& operator<<( |
| 60 std::ostream& os, |
| 61 const LpcmMediaTypeDetailsPtr& value); |
| 62 std::ostream& operator<<( |
| 63 std::ostream& os, |
| 64 const LpcmMediaTypeSetDetailsPtr& value); |
| 65 std::ostream& operator<<( |
| 66 std::ostream& os, |
| 67 const CompressedAudioMediaTypeDetailsPtr& value); |
| 68 std::ostream& operator<<( |
| 69 std::ostream& os, |
| 70 const CompressedAudioMediaTypeSetDetailsPtr& value); |
| 71 std::ostream& operator<<( |
| 72 std::ostream& os, |
| 73 const VideoMediaTypeDetailsPtr& value); |
| 74 std::ostream& operator<<( |
| 75 std::ostream& os, |
| 76 const VideoMediaTypeSetDetailsPtr& value); |
| 77 std::ostream& operator<<( |
| 78 std::ostream& os, |
| 79 const MediaSourceStreamDescriptorPtr& value); |
| 80 |
| 81 } // namespace media |
| 82 } // namespace mojo |
| 83 |
| 84 #endif // SERVICES_MEDIA_FRAMEWORK_MOJO_MOJO_FORMATTING_H_ |
| OLD | NEW |