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

Side by Side Diff: media/cast/sender/video_sender.h

Issue 545593002: [Cast] Track audio queued in encoder; account for it in ShouldDropNextFrame(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + MERGE (post-hubbe's refactoring changes) Created 6 years, 3 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
« no previous file with comments | « media/cast/sender/frame_sender.cc ('k') | media/cast/sender/video_sender.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_CAST_SENDER_VIDEO_SENDER_H_ 5 #ifndef MEDIA_CAST_SENDER_VIDEO_SENDER_H_
6 #define MEDIA_CAST_SENDER_VIDEO_SENDER_H_ 6 #define MEDIA_CAST_SENDER_VIDEO_SENDER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // Note: It is not guaranteed that |video_frame| will actually be encoded and 50 // Note: It is not guaranteed that |video_frame| will actually be encoded and
51 // sent, if VideoSender detects too many frames in flight. Therefore, clients 51 // sent, if VideoSender detects too many frames in flight. Therefore, clients
52 // should be careful about the rate at which this method is called. 52 // should be careful about the rate at which this method is called.
53 // 53 //
54 // Note: It is invalid to call this method if InitializationResult() returns 54 // Note: It is invalid to call this method if InitializationResult() returns
55 // anything but STATUS_VIDEO_INITIALIZED. 55 // anything but STATUS_VIDEO_INITIALIZED.
56 void InsertRawVideoFrame(const scoped_refptr<media::VideoFrame>& video_frame, 56 void InsertRawVideoFrame(const scoped_refptr<media::VideoFrame>& video_frame,
57 const base::TimeTicks& capture_time); 57 const base::TimeTicks& capture_time);
58 58
59 protected: 59 protected:
60 virtual int GetNumberOfFramesInEncoder() const OVERRIDE;
60 virtual void OnAck(uint32 frame_id) OVERRIDE; 61 virtual void OnAck(uint32 frame_id) OVERRIDE;
61 62
62 private: 63 private:
64 // Called by the |video_encoder_| with the next EncodedFrame to send.
65 void OnEncodedVideoFrame(int encoder_bitrate,
66 scoped_ptr<EncodedFrame> encoded_frame);
67
63 // Encodes media::VideoFrame images into EncodedFrames. Per configuration, 68 // Encodes media::VideoFrame images into EncodedFrames. Per configuration,
64 // this will point to either the internal software-based encoder or a proxy to 69 // this will point to either the internal software-based encoder or a proxy to
65 // a hardware-based encoder. 70 // a hardware-based encoder.
66 scoped_ptr<VideoEncoder> video_encoder_; 71 scoped_ptr<VideoEncoder> video_encoder_;
67 72
73 // The number of frames queued for encoding, but not yet sent.
74 int frames_in_encoder_;
75
68 // Remember what we set the bitrate to before, no need to set it again if 76 // Remember what we set the bitrate to before, no need to set it again if
69 // we get the same value. 77 // we get the same value.
70 uint32 last_bitrate_; 78 uint32 last_bitrate_;
71 79
72 // NOTE: Weak pointers must be invalidated before all other member variables. 80 // NOTE: Weak pointers must be invalidated before all other member variables.
73 base::WeakPtrFactory<VideoSender> weak_factory_; 81 base::WeakPtrFactory<VideoSender> weak_factory_;
74 82
75 DISALLOW_COPY_AND_ASSIGN(VideoSender); 83 DISALLOW_COPY_AND_ASSIGN(VideoSender);
76 }; 84 };
77 85
78 } // namespace cast 86 } // namespace cast
79 } // namespace media 87 } // namespace media
80 88
81 #endif // MEDIA_CAST_SENDER_VIDEO_SENDER_H_ 89 #endif // MEDIA_CAST_SENDER_VIDEO_SENDER_H_
OLDNEW
« no previous file with comments | « media/cast/sender/frame_sender.cc ('k') | media/cast/sender/video_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698