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

Side by Side Diff: media/video/encoded_video_source.h

Issue 16320005: Define EncodedVideoSource and RtcCapturedEncodingVideoCapturer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 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
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_VIDEO_ENCODED_VIDEO_SOURCE_H_
Ami GONE FROM CHROMIUM 2013/06/08 00:18:01 TODO+crbug(m30) for merging this into VEA
hshi1 2013/06/11 00:48:20 Done.
6 #define MEDIA_VIDEO_ENCODED_VIDEO_SOURCE_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "media/base/encoded_bitstream_buffer.h"
10 #include "media/video/video_encode_types.h"
11
12 namespace media {
13
14 // Class to represent encoded video bitstream.
Ami GONE FROM CHROMIUM 2013/06/08 00:18:01 o rly?
hshi1 2013/06/11 19:51:22 Proposed change: remove the entire EVB definition.
15 class MEDIA_EXPORT EncodedVideoBitstream :
Ami GONE FROM CHROMIUM 2013/06/08 00:18:01 Is it not the case that bitstreams are owned by so
16 public base::RefCountedThreadSafe<EncodedVideoBitstream> {
17 public:
18 class MEDIA_EXPORT Client {
19 public:
20 // After OnStreaming callback stream shall be considered to be streaming.
Ami GONE FROM CHROMIUM 2013/06/08 00:18:01 Oh, shall it?? Can you make a pass and cull usele
hshi1 2013/06/11 19:51:22 Got rid of the EVB altogether.
21 virtual void OnBitstreamStreaming(
Ami GONE FROM CHROMIUM 2013/06/08 00:18:01 Drop "Bitstream" from the name of each of the func
hshi1 2013/06/11 00:48:20 Made the following changes: OnBitstreamStreaming -
22 scoped_refptr<EncodedVideoBitstream> bitstream,
Ami GONE FROM CHROMIUM 2013/06/08 00:18:01 The |bitstream| param to each of these methods is
hshi1 2013/06/11 00:48:20 You're correct; removed.
23 const VideoEncodingParameters& params) = 0;
24
25 // After OnRemoved client has to stop using the bitstream object and
26 // expecting bitstream buffers for that stream. OnRemoved will be called
27 // also in case of any unrecoverable failure in the capturer. After
28 // OnRemoved is called from a stream it is guaranteed that that there will
29 // be no longer pending calls coming in.
30 virtual void OnBitstreamRemoved(
31 scoped_refptr<EncodedVideoBitstream> bitstream) = 0;
32
33 // OnBitstreamReady delivers the captured bitstream buffer by buffer to the
34 // client.
35 virtual void OnBitstreamReady(
Ami GONE FROM CHROMIUM 2013/06/08 00:18:01 s/Bitstream/Buffer/
hshi1 2013/06/11 00:48:20 Done.
36 scoped_refptr<EncodedVideoBitstream> bitstream,
37 scoped_refptr<const EncodedBitstreamBuffer> buffer) = 0;
38
39 // OnBitstreamConfigChanged informs about change in bitstream parameters.
40 virtual void OnBitstreamConfigChanged(
41 scoped_refptr<EncodedVideoBitstream> bitstream,
42 const RuntimeVideoEncodingParameters& params) = 0;
43 };
44
45 // TrySetBitstreamConfig issues a reconfiguration request. Old configuration
Ami GONE FROM CHROMIUM 2013/06/08 00:18:01 comment out of date (and tortured)
hshi1 2013/06/11 00:48:20 Done.
46 // must be considered to be the valid configuration until
47 // OnBitstreamConfigChanged callback has been issued with value signalling
48 // successful change.
49 virtual void TryConfigure(const RuntimeVideoEncodingParameters& params) = 0;
50
51 protected:
Ami GONE FROM CHROMIUM 2013/06/08 00:18:01 Here and elsewhere you seem to think that RCTS<> r
hshi1 2013/06/11 19:51:22 N/A (removed).
52 virtual ~EncodedVideoBitstream() {};
53 friend class base::RefCountedThreadSafe<EncodedVideoBitstream>;
54 };
55
56 // Class to represent any encoded video source. Anything that provides encoded
57 // video can be an EncodedVideoSource. Notable examples of this can be video
58 // encoder and webcam that has encoding capability.
59 class MEDIA_EXPORT EncodedVideoSource {
Ami GONE FROM CHROMIUM 2013/06/08 00:18:01 Is there no need to report errors other than OnBit
hshi1 2013/06/11 00:48:20 Currently no; do you think I should add a separate
60 public:
61
62 class Observer {
63 public:
64 // Invoked when an encoded video source's capabilities become available.
65 virtual void OnCapabilitiesAvailable(EncodedVideoSource* source) = 0;
Ami GONE FROM CHROMIUM 2013/06/08 00:18:01 Single-method interfaces are better served by a ca
hshi1 2013/06/11 00:48:20 Removed this caps observer business entirely (see
66
67 protected:
68 virtual ~Observer() {}
69 };
70
71 virtual ~EncodedVideoSource() {};
72
73 // Adds/removes observer to receive OnCapabilitiesAvailable notification.
74 virtual void AddCapabilitiesObserver(Observer* observer) = 0;
75 virtual void RemoveCapabilitiesObserver(Observer* observer) = 0;
76
77 // StartFetchCapabilities initiates an asynchronous query for the types of
78 // encoded bitstream supported by the encoder. When the results become
79 // available, EncodedVideoSource will notify observers via the
80 // OnCapabilitiesAvailable() method.
81 virtual void StartFetchCapabilities() = 0;
82
83 // GetCapabilities informs the client what type of encoded bitstream encoder
84 // is capable to provide. Constraints in the reported capabilities should be
85 // obeyed when configuring bitstreams.
86 virtual VideoEncodingCapability GetCapabilities() = 0;
Ami GONE FROM CHROMIUM 2013/06/08 00:18:01 Observer, {Add,Remove}CapabilitiesObserver, StartF
hshi1 2013/06/11 00:48:20 Thanks for the suggestion, I've removed the observ
87
88 // OpenBitstream returns object for the stream being added. Client must
89 // consider the returned stream valid until OnBitstreamRemoved callback is
90 // called with the id. Client should check the parameters agains limits
91 // reported by GetCapabilities before trying to issue an request to add an
92 // encoded bitstream. EncodedVideoSource retains the ownership of
93 // EncodedVideoBitstream and client just has the pointer to it.
Ami GONE FROM CHROMIUM 2013/06/08 00:18:01 Again, this comment is craxy.
hshi1 2013/06/11 19:51:22 Now that EVB is gone, I've simplified this to be a
94 virtual scoped_refptr<EncodedVideoBitstream> OpenBitstream(
Ami GONE FROM CHROMIUM 2013/06/08 00:18:01 This API was built to support the notion of multip
hshi1 2013/06/11 00:48:20 Talked to sheu@. I'm removing all stream_id and as
95 EncodedVideoBitstream::Client* client,
Ami GONE FROM CHROMIUM 2013/06/08 00:18:01 doco lifecycle anytime ownership is not clarified
96 const VideoEncodingParameters& params) = 0;
97 // CloseBitstream removes the bitstream.
98 virtual void CloseBitstream(
99 scoped_refptr<media::EncodedVideoBitstream> bitstream) = 0;
100
101 // ReturnBitstreamBuffer notifies that the data within the buffer has been
102 // processed and it can be reused to encode upcoming bitstream.
103 virtual void ReturnBitstreamBuffer(
Ami GONE FROM CHROMIUM 2013/06/08 00:18:01 It's craxy that buffers are handed to EVB::Client
hshi1 2013/06/11 19:51:22 EVB is now gone and EVB::Client is moved to become
104 scoped_refptr<media::EncodedVideoBitstream> bitstream,
105 scoped_refptr<const media::EncodedBitstreamBuffer> buffer) = 0;
106 };
107
108 } // namespace media
109
110 #endif // MEDIA_VIDEO_ENCODED_VIDEO_SOURCE_H_
111
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698