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

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: Addressing Ami's comments - part 5. 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_
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 any encoded video source. Anything that provides encoded
15 // video can be an EncodedVideoSource. Notable examples of this can be video
16 // encoder and webcam that has encoding capabilities.
Ami GONE FROM CHROMIUM 2013/06/12 01:44:06 Add a TODO pointing to http://crbug.com/248334.
hshi1 2013/06/12 17:52:39 Done.
17 class MEDIA_EXPORT EncodedVideoSource {
18 public:
19 class MEDIA_EXPORT Client {
20 public:
21 // After OnStreaming callback stream shall be considered to be streaming.
Ami GONE FROM CHROMIUM 2013/06/12 01:44:06 I think you missed the point of my comment: Oh, s
hshi1 2013/06/12 17:52:39 Done.
22 virtual void OnStreaming(const VideoEncodingParameters& params) = 0;
Ami GONE FROM CHROMIUM 2013/06/12 01:44:06 s/OnStreaming/OnOpened/ to mirror {Open,Close}Bits
hshi1 2013/06/12 17:52:39 Done.
23
24 // After OnClosed client has to stop using the bitstream object and
25 // expecting bitstream buffers for that stream. OnClosed will be called
26 // also in case of any unrecoverable failure in the capturer. After
27 // OnClosed is called from a stream it is guaranteed that that there will
28 // be no longer pending calls coming in.
29 virtual void OnClosed() = 0;
30
31 // OnBufferReady delivers the captured bitstream buffer by buffer to the
32 // client.
33 virtual void OnBufferReady(
34 scoped_refptr<const EncodedBitstreamBuffer> buffer) = 0;
35
36 // OnConfigChanged informs about change in bitstream parameters.
37 virtual void OnConfigChanged(
38 const RuntimeVideoEncodingParameters& params) = 0;
39 };
40
41 // Callback is invoked once RequestCapabilities() is complete.
42 typedef base::Callback<void(const VideoEncodingCapabilities& capabilities)>
43 RequestCapabilitiesCallback;
44
45 // RequestCapabilities initiates an asynchronous query for the types of
46 // encoded bitstream supported by the encoder. This call should invoked only
Ami GONE FROM CHROMIUM 2013/06/12 01:44:06 s/should/should be/
hshi1 2013/06/12 17:52:39 Done.
47 // once. EncodedVideoSource will invoke |callback| when capabilities become
48 // available.
49 virtual void RequestCapabilities(
50 const RequestCapabilitiesCallback& callback) = 0;
51
52 // OpenBitstream opens the bitstream on the encoded video source. Only one
53 // bitstream can be opened for an encoded video source.
54 virtual void OpenBitstream(Client* client,
Ami GONE FROM CHROMIUM 2013/06/12 01:44:06 I think you missed my comment to the effect of: he
hshi1 2013/06/12 17:52:39 I'm going to make a pass and update later today.
55 const VideoEncodingParameters& params) = 0;
Ami GONE FROM CHROMIUM 2013/06/12 01:44:06 indent is off
hshi1 2013/06/12 17:52:39 Done. ("const" is aligned with "Client", is that c
56
57 // CloseBitstream closes the bitstream.
58 virtual void CloseBitstream() = 0;
59
60 // ReturnBitstreamBuffer notifies that the data within the buffer has been
61 // processed and it can be reused to encode upcoming bitstream.
62 virtual void ReturnBitstreamBuffer(
63 scoped_refptr<const media::EncodedBitstreamBuffer> buffer) = 0;
64
65 // TrySetBitstreamConfig requests to change encoding parameters. Old config
66 // must be considered valid until OnConfigChanged is invoked on the client
67 // signalling successful change.
68 virtual void TrySetBitstreamConfig(
69 const RuntimeVideoEncodingParameters& params) = 0;
70 };
71
72 } // namespace media
73
74 #endif // MEDIA_VIDEO_ENCODED_VIDEO_SOURCE_H_
75
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698