OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this |
2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
3 // LICENSE file. | 3 // LICENSE file. |
4 | 4 |
5 #ifndef MEDIA_TOOLS_OMX_TEST_FILE_READER_UTIL_H_ | 5 #ifndef MEDIA_TOOLS_OMX_TEST_FILE_READER_UTIL_H_ |
6 #define MEDIA_TOOLS_OMX_TEST_FILE_READER_UTIL_H_ | 6 #define MEDIA_TOOLS_OMX_TEST_FILE_READER_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // ability. |loop_count| specifies the number of times the input file | 54 // ability. |loop_count| specifies the number of times the input file |
55 // is read. If |enable_csc| is true, input in YV420 is converted to | 55 // is read. If |enable_csc| is true, input in YV420 is converted to |
56 // NV21. | 56 // NV21. |
57 // TODO(jiesun): Make color space more generic not a hard coded color | 57 // TODO(jiesun): Make color space more generic not a hard coded color |
58 // space conversion. | 58 // space conversion. |
59 YuvFileReader(const FilePath& path, | 59 YuvFileReader(const FilePath& path, |
60 int width, | 60 int width, |
61 int height, | 61 int height, |
62 int loop_count, | 62 int loop_count, |
63 bool output_nv21); | 63 bool output_nv21); |
| 64 virtual ~YuvFileReader(); |
| 65 |
64 virtual void Read(uint8** output, int* size); | 66 virtual void Read(uint8** output, int* size); |
65 | 67 |
66 private: | 68 private: |
67 int width_; | 69 int width_; |
68 int height_; | 70 int height_; |
69 int loop_count_; | 71 int loop_count_; |
70 bool output_nv21_; | 72 bool output_nv21_; |
71 scoped_array<uint8> csc_buf_; | 73 scoped_array<uint8> csc_buf_; |
72 | 74 |
73 DISALLOW_COPY_AND_ASSIGN(YuvFileReader); | 75 DISALLOW_COPY_AND_ASSIGN(YuvFileReader); |
(...skipping 24 matching lines...) Expand all Loading... |
98 AVCodecContext* codec_context_; | 100 AVCodecContext* codec_context_; |
99 int target_stream_; | 101 int target_stream_; |
100 scoped_ptr<media::BitstreamConverter> converter_; | 102 scoped_ptr<media::BitstreamConverter> converter_; |
101 | 103 |
102 DISALLOW_COPY_AND_ASSIGN(FFmpegFileReader); | 104 DISALLOW_COPY_AND_ASSIGN(FFmpegFileReader); |
103 }; | 105 }; |
104 | 106 |
105 class H264FileReader : public BasicFileReader { | 107 class H264FileReader : public BasicFileReader { |
106 public: | 108 public: |
107 explicit H264FileReader(const FilePath& path); | 109 explicit H264FileReader(const FilePath& path); |
| 110 virtual ~H264FileReader(); |
108 virtual void Read(uint8** output, int* size); | 111 virtual void Read(uint8** output, int* size); |
109 | 112 |
110 private: | 113 private: |
111 scoped_array<uint8> read_buf_; | 114 scoped_array<uint8> read_buf_; |
112 int current_; | 115 int current_; |
113 int used_; | 116 int used_; |
114 | 117 |
115 DISALLOW_COPY_AND_ASSIGN(H264FileReader); | 118 DISALLOW_COPY_AND_ASSIGN(H264FileReader); |
116 }; | 119 }; |
117 | 120 |
118 } // namespace media | 121 } // namespace media |
119 | 122 |
120 #endif // MEDIA_TOOLS_OMX_TEST_FILE_READER_UTIL_H_ | 123 #endif // MEDIA_TOOLS_OMX_TEST_FILE_READER_UTIL_H_ |
OLD | NEW |