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

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

Issue 21421002: Revert EVS revisions 209760, 298753, 213143. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased at 216225, prepare to land Created 7 years, 4 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/media.gyp ('k') | media/video/video_encode_types.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 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.
17 // TODO(hshi): merge this with VEA interface. http://crbug.com/248334.
18 class EncodedVideoSource {
19 public:
20 class Client {
21 public:
22 // Notifies client that bitstream is opened successfully. The |params|
23 // contains the actual encoding parameters chosen by the browser process.
24 // It may be different from the params requested in OpenBitstream().
25 virtual void OnOpened(const VideoEncodingParameters& params) = 0;
26
27 // Notifies client that bitstream is closed. After this call it is
28 // guaranteed that client will not receive further calls.
29 virtual void OnClosed() = 0;
30
31 // Delivers an encoded bitstream buffer to the client.
32 virtual void OnBufferReady(
33 scoped_refptr<const EncodedBitstreamBuffer> buffer) = 0;
34
35 // Notifies client that encoding parameters has changed. The |params|
36 // contains the current encoding parameters chosen by the browser process.
37 // It may be different from the params requested in TrySetBitstreamConfig().
38 virtual void OnConfigChanged(
39 const RuntimeVideoEncodingParameters& params) = 0;
40 };
41
42 // Callback is invoked once RequestCapabilities() is complete.
43 typedef base::Callback<void(const VideoEncodingCapabilities& capabilities)>
44 RequestCapabilitiesCallback;
45
46 // RequestCapabilities initiates an asynchronous query for the types of
47 // encoded bitstream supported by the encoder. This call should be invoked
48 // only once. EncodedVideoSource will invoke |callback| when capabilities
49 // become available.
50 virtual void RequestCapabilities(
51 const RequestCapabilitiesCallback& callback) = 0;
52
53 // OpenBitstream opens the bitstream on the encoded video source. Only one
54 // bitstream can be opened for an encoded video source.
55 virtual void OpenBitstream(Client* client,
56 const VideoEncodingParameters& params) = 0;
57
58 // CloseBitstream closes the bitstream.
59 virtual void CloseBitstream() = 0;
60
61 // ReturnBitstreamBuffer notifies that the data within the buffer has been
62 // processed and it can be reused to encode upcoming bitstream.
63 virtual void ReturnBitstreamBuffer(
64 scoped_refptr<const media::EncodedBitstreamBuffer> buffer) = 0;
65
66 // TrySetBitstreamConfig requests to change encoding parameters. Old config
67 // must be considered valid until OnConfigChanged is invoked on the client
68 // signaling successful change.
69 virtual void TrySetBitstreamConfig(
70 const RuntimeVideoEncodingParameters& params) = 0;
71
72 // RequestKeyFrame requests a key frame.
73 virtual void RequestKeyFrame() = 0;
74 };
75
76 } // namespace media
77
78 #endif // MEDIA_VIDEO_ENCODED_VIDEO_SOURCE_H_
79
OLDNEW
« no previous file with comments | « media/media.gyp ('k') | media/video/video_encode_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698