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

Side by Side Diff: media/cast/transport/cast_transport_sender.h

Issue 178073004: Cast: IPC from browser to renderer to send packet events from transport to cast library. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed hubbe's comments Created 6 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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 // This is the main interface for the cast transport sender. The cast sender 5 // This is the main interface for the cast transport sender. The cast sender
6 // handles the cast pipeline from encoded frames (both audio and video), to 6 // handles the cast pipeline from encoded frames (both audio and video), to
7 // encryption, packetization and transport. 7 // encryption, packetization and transport.
8 // All configurations are done at creation. 8 // All configurations are done at creation.
9 9
10 // Construction of the Cast Sender and the Cast Transport Sender should be done 10 // Construction of the Cast Sender and the Cast Transport Sender should be done
(...skipping 10 matching lines...) Expand all
21 // due to the weak pointers in the ReceivedPacket method in cast_sender_impl.cc. 21 // due to the weak pointers in the ReceivedPacket method in cast_sender_impl.cc.
22 22
23 #ifndef MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_ 23 #ifndef MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_
24 #define MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_ 24 #define MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_
25 25
26 #include "base/basictypes.h" 26 #include "base/basictypes.h"
27 #include "base/callback.h" 27 #include "base/callback.h"
28 #include "base/single_thread_task_runner.h" 28 #include "base/single_thread_task_runner.h"
29 #include "base/threading/non_thread_safe.h" 29 #include "base/threading/non_thread_safe.h"
30 #include "base/time/tick_clock.h" 30 #include "base/time/tick_clock.h"
31 #include "media/cast/logging/logging_defines.h"
31 #include "media/cast/transport/cast_transport_config.h" 32 #include "media/cast/transport/cast_transport_config.h"
32 #include "media/cast/transport/cast_transport_defines.h" 33 #include "media/cast/transport/cast_transport_defines.h"
33 34
34 namespace media { 35 namespace media {
35 namespace cast { 36 namespace cast {
36 namespace transport { 37 namespace transport {
37 38
38 typedef base::Callback<void(CastTransportStatus status)> 39 typedef base::Callback<void(CastTransportStatus status)>
39 CastTransportStatusCallback; 40 CastTransportStatusCallback;
40 41
41 typedef base::Callback<void(const RtcpSenderInfo& sender_info, 42 typedef base::Callback<void(const RtcpSenderInfo& sender_info,
42 base::TimeTicks time_sent, 43 base::TimeTicks time_sent,
43 uint32 rtp_timestamp)> CastTransportRtpStatistics; 44 uint32 rtp_timestamp)> CastTransportRtpStatistics;
44 45
46 typedef base::Callback<void(const std::vector<PacketEvent>&)>
47 BulkRawEventsCallback;
48
45 // The application should only trigger this class from the transport thread. 49 // The application should only trigger this class from the transport thread.
46 class CastTransportSender : public base::NonThreadSafe { 50 class CastTransportSender : public base::NonThreadSafe {
47 public: 51 public:
48 static CastTransportSender* CreateCastTransportSender( 52 static CastTransportSender* CreateCastTransportSender(
49 base::TickClock* clock, 53 base::TickClock* clock,
50 const CastTransportConfig& config, 54 const CastTransportConfig& config,
51 const CastTransportStatusCallback& status_callback, 55 const CastTransportStatusCallback& status_callback,
56 const BulkRawEventsCallback& raw_events_callback,
52 const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner); 57 const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner);
53 58
54 virtual ~CastTransportSender() {} 59 virtual ~CastTransportSender() {}
55 60
56 // Sets the Cast packet receiver. Should be called after creation on the 61 // Sets the Cast packet receiver. Should be called after creation on the
57 // Cast sender. Packets won't be received until this function is called. 62 // Cast sender. Packets won't be received until this function is called.
58 virtual void SetPacketReceiver( 63 virtual void SetPacketReceiver(
59 const PacketReceiverCallback& packet_receiver) = 0; 64 const PacketReceiverCallback& packet_receiver) = 0;
60 65
61 // The following two functions handle the encoded media frames (audio and 66 // The following two functions handle the encoded media frames (audio and
(...skipping 26 matching lines...) Expand all
88 93
89 virtual void SubscribeVideoRtpStatsCallback( 94 virtual void SubscribeVideoRtpStatsCallback(
90 const CastTransportRtpStatistics& callback) = 0; 95 const CastTransportRtpStatistics& callback) = 0;
91 }; 96 };
92 97
93 } // namespace transport 98 } // namespace transport
94 } // namespace cast 99 } // namespace cast
95 } // namespace media 100 } // namespace media
96 101
97 #endif // MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_ 102 #endif // MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698