| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef MEDIA_BASE_MEDIA_FORMAT_H_ | 5 #ifndef MEDIA_BASE_MEDIA_FORMAT_H_ |
| 6 #define MEDIA_BASE_MEDIA_FORMAT_H_ | 6 #define MEDIA_BASE_MEDIA_FORMAT_H_ |
| 7 | 7 |
| 8 #include <map> |
| 9 #include <string> |
| 10 |
| 8 #include "base/values.h" | 11 #include "base/values.h" |
| 9 | 12 |
| 10 namespace media { | 13 namespace media { |
| 11 | 14 |
| 12 // Common MIME types. | 15 // Common MIME types. |
| 13 namespace mime_type { | 16 namespace mime_type { |
| 14 extern const char kURI[]; | 17 extern const char kURL[]; |
| 15 extern const char kApplicationOctetStream[]; | 18 extern const char kApplicationOctetStream[]; |
| 16 extern const char kMPEGAudio[]; | 19 extern const char kMPEGAudio[]; |
| 17 extern const char kAACAudio[]; | 20 extern const char kAACAudio[]; |
| 18 extern const char kH264AnnexB[]; | 21 extern const char kH264AnnexB[]; |
| 19 extern const char kUncompressedAudio[]; | 22 extern const char kUncompressedAudio[]; |
| 20 extern const char kUncompressedVideo[]; | 23 extern const char kUncompressedVideo[]; |
| 24 extern const char kMajorTypeAudio[]; |
| 25 extern const char kMajorTypeVideo[]; |
| 21 } // namespace mime_type | 26 } // namespace mime_type |
| 22 | 27 |
| 23 // MediaFormat is used to describe the output of a MediaFilterInterface to | 28 // MediaFormat is used to describe the output of a MediaFilterInterface to |
| 24 // determine whether a downstream filter can accept the output from an upstream | 29 // determine whether a downstream filter can accept the output from an upstream |
| 25 // filter. In general, every MediaFormat contains a MIME type describing | 30 // filter. In general, every MediaFormat contains a MIME type describing |
| 26 // its output as well as additional key-values describing additional details. | 31 // its output as well as additional key-values describing additional details. |
| 27 // | 32 // |
| 28 // For example, an audio decoder could output audio/x-uncompressed and include | 33 // For example, an audio decoder could output audio/x-uncompressed and include |
| 29 // additional key-values such as the number of channels and the sample rate. | 34 // additional key-values such as the number of channels and the sample rate. |
| 30 // An audio renderer would use this information to properly initialize the | 35 // An audio renderer would use this information to properly initialize the |
| 31 // audio hardware before playback started. | 36 // audio hardware before playback started. |
| 32 // | 37 // |
| 33 // It's also perfectly acceptable to create your own MIME types and standards | 38 // It's also perfectly acceptable to create your own MIME types and standards |
| 34 // to allow communication between two filters that goes beyond the basics | 39 // to allow communication between two filters that goes beyond the basics |
| 35 // described here. For example, you could write a video decoder that outputs | 40 // described here. For example, you could write a video decoder that outputs |
| 36 // a MIME type video/x-special for which your video renderer knows it's some | 41 // a MIME type video/x-special for which your video renderer knows it's some |
| 37 // special form of decompressed video output that regular video renderers | 42 // special form of decompressed video output that regular video renderers |
| 38 // couldn't handle. | 43 // couldn't handle. |
| 39 class MediaFormat { | 44 class MediaFormat { |
| 40 public: | 45 public: |
| 41 // Common keys. | 46 // Common keys. |
| 42 static const char kMimeType[]; | 47 static const char kMimeType[]; |
| 43 static const char kURI[]; | 48 static const char kURL[]; |
| 44 static const char kSurfaceFormat[]; | 49 static const char kSurfaceFormat[]; |
| 45 static const char kSampleRate[]; | 50 static const char kSampleRate[]; |
| 46 static const char kSampleBits[]; | 51 static const char kSampleBits[]; |
| 47 static const char kChannels[]; | 52 static const char kChannels[]; |
| 48 static const char kWidth[]; | 53 static const char kWidth[]; |
| 49 static const char kHeight[]; | 54 static const char kHeight[]; |
| 50 | 55 |
| 51 MediaFormat(); | 56 MediaFormat(); |
| 52 ~MediaFormat(); | 57 ~MediaFormat(); |
| 53 | 58 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 75 | 80 |
| 76 typedef std::map<std::string, Value*> ValueMap; | 81 typedef std::map<std::string, Value*> ValueMap; |
| 77 ValueMap value_map_; | 82 ValueMap value_map_; |
| 78 | 83 |
| 79 DISALLOW_COPY_AND_ASSIGN(MediaFormat); | 84 DISALLOW_COPY_AND_ASSIGN(MediaFormat); |
| 80 }; | 85 }; |
| 81 | 86 |
| 82 } // namespace media | 87 } // namespace media |
| 83 | 88 |
| 84 #endif // MEDIA_BASE_MEDIA_FORMAT_H_ | 89 #endif // MEDIA_BASE_MEDIA_FORMAT_H_ |
| OLD | NEW |