| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 #ifndef TEST_VIDEO_SOURCE_H_ | 10 #ifndef TEST_VIDEO_SOURCE_H_ |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 // Undefining stringification macros because they are not used elsewhere | 44 // Undefining stringification macros because they are not used elsewhere |
| 45 #undef TO_STRING | 45 #undef TO_STRING |
| 46 #undef STRINGIFY | 46 #undef STRINGIFY |
| 47 | 47 |
| 48 static FILE *OpenTestDataFile(const std::string& file_name) { | 48 static FILE *OpenTestDataFile(const std::string& file_name) { |
| 49 const std::string path_to_source = GetDataPath() + "/" + file_name; | 49 const std::string path_to_source = GetDataPath() + "/" + file_name; |
| 50 return fopen(path_to_source.c_str(), "rb"); | 50 return fopen(path_to_source.c_str(), "rb"); |
| 51 } | 51 } |
| 52 | 52 |
| 53 static FILE *OpenTestOutFile(const std::string& file_name) { |
| 54 const std::string path_to_source = GetDataPath() + "/" + file_name; |
| 55 return fopen(path_to_source.c_str(), "wb"); |
| 56 } |
| 57 |
| 58 static FILE *OpenTempOutFile() { |
| 59 return tmpfile(); |
| 60 } |
| 61 |
| 53 // Abstract base class for test video sources, which provide a stream of | 62 // Abstract base class for test video sources, which provide a stream of |
| 54 // vpx_image_t images with associated timestamps and duration. | 63 // vpx_image_t images with associated timestamps and duration. |
| 55 class VideoSource { | 64 class VideoSource { |
| 56 public: | 65 public: |
| 57 virtual ~VideoSource() {} | 66 virtual ~VideoSource() {} |
| 58 | 67 |
| 59 // Prepare the stream for reading, rewind/open as necessary. | 68 // Prepare the stream for reading, rewind/open as necessary. |
| 60 virtual void Begin() = 0; | 69 virtual void Begin() = 0; |
| 61 | 70 |
| 62 // Advance the cursor to the next frame | 71 // Advance the cursor to the next frame |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 virtual const uint8_t *cxdata() const = 0; | 194 virtual const uint8_t *cxdata() const = 0; |
| 186 | 195 |
| 187 virtual size_t frame_size() const = 0; | 196 virtual size_t frame_size() const = 0; |
| 188 | 197 |
| 189 virtual unsigned int frame_number() const = 0; | 198 virtual unsigned int frame_number() const = 0; |
| 190 }; | 199 }; |
| 191 | 200 |
| 192 } // namespace libvpx_test | 201 } // namespace libvpx_test |
| 193 | 202 |
| 194 #endif // TEST_VIDEO_SOURCE_H_ | 203 #endif // TEST_VIDEO_SOURCE_H_ |
| OLD | NEW |