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

Side by Side Diff: media/base/encoded_bitstream_buffer.h

Issue 12379011: Interfaces for encoded video sources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Stylization Created 7 years, 9 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
OLDNEW
(Empty)
1 // Copyright (c) 2013 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_BASE_ENCODED_BITSTREAM_BUFFER_H_
6 #define MEDIA_BASE_ENCODED_BITSTREAM_BUFFER_H_
7
8 #include <ostream>
9
10 #include "base/memory/ref_counted.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/time.h"
13 #include "media/base/media_export.h"
14
15 namespace media {
16
17 // General encoded video bitstream buffer.
Ami GONE FROM CHROMIUM 2013/03/02 10:47:16 This is not a useful comment. Things that are usef
Ville-Mikko Rautio 2013/03/04 14:02:25 Done.
18 class MEDIA_EXPORT EncodedBitstreamBuffer :
tommi (sloooow) - chröme 2013/03/01 16:03:43 this class looks single threaded. Can you either i
Ami GONE FROM CHROMIUM 2013/03/02 10:47:16 Shouldn't the ctor take a EncodingMetadata struct
Ville-Mikko Rautio 2013/03/04 14:02:25 It could take EncodingMetadata, I added TODO to re
Ville-Mikko Rautio 2013/03/04 14:02:25 I want this class to be readable concurrently from
19 public base::RefCountedThreadSafe<EncodedBitstreamBuffer> {
Ami GONE FROM CHROMIUM 2013/03/02 10:47:16 Unless you have a good reason for this to be refco
Ville-Mikko Rautio 2013/03/04 14:02:25 The original purpose of this class has been to car
20 public:
21 // Constructor that allocates empty buffer of |size|.
22 EncodedBitstreamBuffer(size_t size, base::Time timestamp, int temporal_layer);
tommi (sloooow) - chröme 2013/03/01 16:03:43 nit: const base::Time&
Ami GONE FROM CHROMIUM 2013/03/02 10:47:16 base::Time is just an int64; it's actually more ef
Ami GONE FROM CHROMIUM 2013/03/02 10:47:16 In what situation will you want this overload?
Ville-Mikko Rautio 2013/03/04 14:02:25 According to Ami copy is more efficient, going wit
Ville-Mikko Rautio 2013/03/04 14:02:25 I thought that this could be a situation for an so
23 // Constructor that copies |size| bytes of data from |buffer| into newly
24 // allocated buffer.
25 EncodedBitstreamBuffer(uint8* buffer,
26 size_t size,
27 base::Time timestamp,
tommi (sloooow) - chröme 2013/03/01 16:03:43 same here
Ville-Mikko Rautio 2013/03/04 14:02:25 According to Ami copy is more efficient, going wit
28 int temporal_layer);
29
30 // Accessors for properties.
31 uint8* buffer() const;
tommi (sloooow) - chröme 2013/03/01 16:03:43 nit: we rarely have const methods that provide wri
Ville-Mikko Rautio 2013/03/04 14:02:25 I'll take the full const way to emphasize read-onl
32 size_t size() const;
33 bool key_frame() const;
Ami GONE FROM CHROMIUM 2013/03/02 10:47:16 these bool accessors (and members) probably want a
Ville-Mikko Rautio 2013/03/04 14:02:25 Done.
34 bool altref_frame() const;
35 bool golden_frame() const;
36 base::Time timestamp() const;
tommi (sloooow) - chröme 2013/03/01 16:03:43 nit: const base::Time& timestamp() const;
Ville-Mikko Rautio 2013/03/04 14:02:25 Done.
37 int temporal_layer() const;
Ami GONE FROM CHROMIUM 2013/03/02 10:47:16 _id ?
Ville-Mikko Rautio 2013/03/04 14:02:25 Done.
38 bool droppable() const;
39 bool layer_sync() const;
40
41 // Setters for properties.
42 void MarkKeyFrame();
Ami GONE FROM CHROMIUM 2013/03/02 10:47:16 s/Mark/Set/ here and below. Although since they're
Ville-Mikko Rautio 2013/03/04 14:02:25 I'm taking these all down for benefit of the Encod
43 void MarkAltRef();
44 void MarkGolden();
Ami GONE FROM CHROMIUM 2013/03/02 10:47:16 These make this look like an EncodedVP8BitstreamBu
Ville-Mikko Rautio 2013/03/04 14:02:25 That's right. In fact I had EncodedBitstreamBuffer
45 void MarkDroppable();
46 void MarkLayerSync();
holmer 2013/03/04 13:36:40 Can you comment on these properties? In particular
Ville-Mikko Rautio 2013/03/05 13:02:18 I thought these with "is-a" semantics. Does WebRTC
holmer 2013/03/05 13:32:54 But what does it mean that it is an AltRef frame?
vmr 2013/03/06 05:51:29 Sorry, I should have been clearer. Intention is t
holmer 2013/03/07 14:20:32 Thanks for clarifying. WebRTC doesn't use it expl
47
48 protected:
49 virtual ~EncodedBitstreamBuffer(); // Destructor. Will deallocate the buffers.
Ami GONE FROM CHROMIUM 2013/03/02 10:47:16 Comment does not add value. ~ means destructor sco
Ville-Mikko Rautio 2013/03/04 14:02:25 Done.
50 friend class base::RefCountedThreadSafe<EncodedBitstreamBuffer>;
51
52 private:
53 scoped_ptr<uint8[]> buffer_;
54 size_t size_;
55 base::Time timestamp_;
56 bool key_frame_;
57 int temporal_layer_;
58 bool altref_frame_;
59 bool golden_frame_;
60 // Determines whether the buffer is droppable. With droppable buffers decoding
61 // can be skipped without affecting the decoding of subsequent buffers.
62 bool droppable_;
63 // For temporal base layer, the field must be set to 0 only if it only depends
64 // on previous key frame. For temporal enhancement layers the layer sync must
65 // be set to true, if the buffer depends only on the previous temporal base
66 // layer buffer.
67 bool layer_sync_;
68 DISALLOW_COPY_AND_ASSIGN(EncodedBitstreamBuffer);
Ami GONE FROM CHROMIUM 2013/03/02 10:47:16 Add an empty line before this one?
Ville-Mikko Rautio 2013/03/04 14:02:25 Done.
69 };
70
71 } // namespace media
72
73 // Pretty print operator for the EncodedBitstreamBuffer.
74 std::ostream& operator<<(std::ostream& output,
tommi (sloooow) - chröme 2013/03/01 16:03:43 although chromium uses streams for logging, I beli
Ville-Mikko Rautio 2013/03/04 14:02:25 I know. I just really want to have a way to log th
75 const media::EncodedBitstreamBuffer& b);
76
77 #endif // MEDIA_BASE_ENCODED_BITSTREAM_BUFFER_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/encoded_bitstream_buffer.cc » ('j') | media/base/encoded_bitstream_buffer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698