OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 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 MEDIA_FILTERS_IVF_PARSER_H_ | |
6 #define MEDIA_FILTERS_IVF_PARSER_H_ | |
7 | |
8 #include <stddef.h> | |
9 #include <stdint.h> | |
10 | |
11 #include "base/macros.h" | |
12 #include "media/base/media_export.h" | |
13 | |
14 namespace media { | |
15 | |
16 struct MEDIA_EXPORT IvfFileHeader { | |
wuchengli
2015/07/30 06:26:13
Remove IvfFileHeader and IvfFrameHeader in video_e
kcwu
2015/07/30 11:52:52
Done.
I preferred timebase_denum and timebase_num
| |
17 uint16_t version; | |
18 uint16_t header_size; | |
19 uint32_t fourcc; | |
20 uint16_t width; | |
21 uint16_t height; | |
22 uint32_t timebase_denum; | |
23 uint32_t timebase_num; | |
24 uint32_t num_frames; | |
25 uint32_t unused; | |
26 }; | |
wuchengli
2015/07/30 06:26:13
__attribute__((packed)) for video_encode_accelerat
kcwu
2015/07/30 11:52:52
I found #pragma pack is portable (across chrome pl
| |
27 | |
28 struct MEDIA_EXPORT IvfFrameHeader { | |
29 uint32_t data_size; | |
30 int64_t timestamp; | |
31 const uint8_t* data; | |
32 }; | |
33 | |
34 class MEDIA_EXPORT IvfParser { | |
xhwang
2015/07/29 16:43:42
Can you add some comments explaining what IVF stan
kcwu
2015/07/30 11:52:52
Done.
| |
35 public: | |
36 IvfParser(); | |
37 | |
38 // Initializes the parser for IVF |stream| with size |size| and parses the | |
39 // file header. Returns true on success. | |
40 bool Initialize(const uint8_t* stream, | |
41 size_t size, | |
42 IvfFileHeader* file_header); | |
43 | |
44 // Parses the next frame. Returns true if the next frame is parsed without | |
45 // error. | |
46 bool ParseNextFrame(IvfFrameHeader* frame_header); | |
47 | |
48 private: | |
49 bool ParseFileHeader(IvfFileHeader* file_header); | |
50 | |
51 const uint8_t* ptr_; | |
52 const uint8_t* end_; | |
xhwang
2015/07/29 16:43:42
DISALLOW_COPY_AND_ASSIGN?
xhwang
2015/07/29 16:43:42
Comment on what ptr_ and end_ are.
kcwu
2015/07/30 11:52:52
Done.
kcwu
2015/07/30 11:52:52
Done.
| |
53 }; | |
54 | |
55 } // namespace media | |
56 | |
57 #endif // MEDIA_FILTERS_IVF_PARSER_H_ | |
OLD | NEW |