Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: media/webm/webm_stream_parser.h

Issue 10534096: Generalize AesDecryptor to make it more spec compliant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/mp4/mp4_stream_parser.cc ('k') | media/webm/webm_stream_parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_WEBM_WEBM_STREAM_PARSER_H_ 5 #ifndef MEDIA_WEBM_WEBM_STREAM_PARSER_H_
6 #define MEDIA_WEBM_WEBM_STREAM_PARSER_H_ 6 #define MEDIA_WEBM_WEBM_STREAM_PARSER_H_
7 7
8 #include "base/callback_forward.h" 8 #include "base/callback_forward.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "media/base/audio_decoder_config.h" 10 #include "media/base/audio_decoder_config.h"
11 #include "media/base/buffers.h" 11 #include "media/base/buffers.h"
12 #include "media/base/byte_queue.h" 12 #include "media/base/byte_queue.h"
13 #include "media/base/stream_parser.h" 13 #include "media/base/stream_parser.h"
14 #include "media/base/video_decoder_config.h" 14 #include "media/base/video_decoder_config.h"
15 #include "media/webm/webm_cluster_parser.h" 15 #include "media/webm/webm_cluster_parser.h"
16 16
17 namespace media { 17 namespace media {
18 18
19 class WebMStreamParser : public StreamParser { 19 class WebMStreamParser : public StreamParser {
20 public: 20 public:
21 WebMStreamParser(); 21 WebMStreamParser();
22 virtual ~WebMStreamParser(); 22 virtual ~WebMStreamParser();
23 23
24 // StreamParser implementation. 24 // StreamParser implementation.
25 virtual void Init(const InitCB& init_cb, const NewConfigCB& config_cb, 25 virtual void Init(const InitCB& init_cb, const NewConfigCB& config_cb,
26 const NewBuffersCB& audio_cb, 26 const NewBuffersCB& audio_cb,
27 const NewBuffersCB& video_cb, 27 const NewBuffersCB& video_cb,
28 const KeyNeededCB& key_needed_cb, 28 const NeedKeyCB& need_key_cb,
29 const NewMediaSegmentCB& new_segment_cb) OVERRIDE; 29 const NewMediaSegmentCB& new_segment_cb) OVERRIDE;
30 virtual void Flush() OVERRIDE; 30 virtual void Flush() OVERRIDE;
31 virtual bool Parse(const uint8* buf, int size) OVERRIDE; 31 virtual bool Parse(const uint8* buf, int size) OVERRIDE;
32 32
33 private: 33 private:
34 enum State { 34 enum State {
35 kWaitingForInit, 35 kWaitingForInit,
36 kParsingHeaders, 36 kParsingHeaders,
37 kParsingClusters, 37 kParsingClusters,
38 kError 38 kError
(...skipping 18 matching lines...) Expand all
57 // Returns < 0 if the parse fails. 57 // Returns < 0 if the parse fails.
58 // Returns 0 if more data is needed. 58 // Returns 0 if more data is needed.
59 // Returning > 0 indicates success & the number of bytes parsed. 59 // Returning > 0 indicates success & the number of bytes parsed.
60 int ParseCluster(const uint8* data, int size); 60 int ParseCluster(const uint8* data, int size);
61 61
62 State state_; 62 State state_;
63 InitCB init_cb_; 63 InitCB init_cb_;
64 NewConfigCB config_cb_; 64 NewConfigCB config_cb_;
65 NewBuffersCB audio_cb_; 65 NewBuffersCB audio_cb_;
66 NewBuffersCB video_cb_; 66 NewBuffersCB video_cb_;
67 KeyNeededCB key_needed_cb_; 67 NeedKeyCB need_key_cb_;
68 NewMediaSegmentCB new_segment_cb_; 68 NewMediaSegmentCB new_segment_cb_;
69 69
70 // True if a new cluster id has been seen, but no audio or video buffers have 70 // True if a new cluster id has been seen, but no audio or video buffers have
71 // been parsed yet. 71 // been parsed yet.
72 bool waiting_for_buffers_; 72 bool waiting_for_buffers_;
73 73
74 scoped_ptr<WebMClusterParser> cluster_parser_; 74 scoped_ptr<WebMClusterParser> cluster_parser_;
75 ByteQueue byte_queue_; 75 ByteQueue byte_queue_;
76 76
77 DISALLOW_COPY_AND_ASSIGN(WebMStreamParser); 77 DISALLOW_COPY_AND_ASSIGN(WebMStreamParser);
78 }; 78 };
79 79
80 } // namespace media 80 } // namespace media
81 81
82 #endif // MEDIA_WEBM_WEBM_STREAM_PARSER_H_ 82 #endif // MEDIA_WEBM_WEBM_STREAM_PARSER_H_
OLDNEW
« no previous file with comments | « media/mp4/mp4_stream_parser.cc ('k') | media/webm/webm_stream_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698