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

Unified Diff: media/cast/net/cast_transport_sender.h

Issue 1515023002: Simplify interface for media/cast: CastTransportSenderImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: media/cast/net/cast_transport_sender.h
diff --git a/media/cast/net/cast_transport_sender.h b/media/cast/net/cast_transport_sender.h
index b20c9df0488a06dc0ae5f4529abde83ae0431961..ef8704933833796894be60252dc5f3e5b3eee764 100644
--- a/media/cast/net/cast_transport_sender.h
+++ b/media/cast/net/cast_transport_sender.h
@@ -56,17 +56,68 @@ typedef base::Callback<void(scoped_ptr<std::vector<FrameEvent>>,
// The application should only trigger this class from the transport thread.
class CastTransportSender : public base::NonThreadSafe {
public:
- static scoped_ptr<CastTransportSender> Create(
- net::NetLog* net_log,
- base::TickClock* clock,
- const net::IPEndPoint& local_end_point,
- const net::IPEndPoint& remote_end_point,
- scoped_ptr<base::DictionaryValue> options,
- const CastTransportStatusCallback& status_callback,
- const BulkRawEventsCallback& raw_events_callback,
- base::TimeDelta raw_events_callback_interval,
- const PacketReceiverCallback& packet_callback,
- const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner);
+ // Interface to create a cast transport sender / receiver.
imcheng 2015/12/17 00:18:10 I don't think this comment is not accurate. If I u
xjz 2015/12/17 22:54:57 Done.
+ class Client {
+ public:
+ // Audio and Video transport status change is reported on this callback.
+ virtual void OnStatusChange(CastTransportStatus status) = 0;
+
+ // Raw events will be invoked on this callback every
imcheng 2015/12/17 00:18:10 This comment should probably go in CreateParams. A
xjz 2015/12/17 22:54:58 Add comments too in CreateParams. Yes, the code ch
+ // |logging_flush_interval|. If the user is not interested in raw events,
+ // |logging_flush_interval| should be set to |base::TimeDelta|.
imcheng 2015/12/17 00:18:10 s/base::TimeDelta/base::TimeDelta()
xjz 2015/12/17 22:54:57 Done.
+ virtual void OnReceivedLoggingEvents(
+ scoped_ptr<std::vector<FrameEvent>>,
imcheng 2015/12/17 00:18:10 Add names for the input args.
xjz 2015/12/17 22:54:57 Done.
+ scoped_ptr<std::vector<PacketEvent>>) = 0;
+
+ // Incoming packets that do not match the channels created by
+ // Initialize{Audio,Video} will report to this callback.
+ virtual void OnReceivedPackets(scoped_ptr<Packet> packet) = 0;
+
+ virtual ~Client();
imcheng 2015/12/17 00:18:10 nit: Place the destructor before the other pure vi
xjz 2015/12/17 22:54:57 Done.
+ };
+
+ // Parameters to create a cast transport sender / receiver.
+ // |options| contains optional settings for the transport, possible
+ // keys are:
+ // "DSCP" (value ignored)
+ // - Turns DSCP on (higher IP Precedence and Type of Service).
+ // "disable_non_blocking_io" (value ignored)
+ // - Windows only. Turns off non-blocking IO for the socket.
+ // Note: Non-blocking IO is, by default, enabled on all platforms.
+ // "pacer_target_burst_size": int
+ // - Specifies how many packets to send per 10 ms ideally.
+ // "pacer_max_burst_size": int
+ // - Specifies how many pakcets to send per 10 ms, maximum.
+ // "send_buffer_min_size": int
+ // - Specifies the minimum socket send buffer size.
+ // "disable_wifi_scan" (value ignored)
+ // - Disable wifi scans while streaming.
+ // "media_streaming_mode" (value ignored)
+ // - Turn media streaming mode on.
+ // Note, these options may be ignored on some platforms.
+ struct CreateParams {
+ CreateParams(
imcheng 2015/12/17 00:18:10 I feel some of these arguments do not belong in th
xjz 2015/12/17 22:54:57 There are only three pure data. |options| is also
+ net::NetLog* log,
+ base::TickClock* input_clock,
+ net::IPEndPoint local_addr,
+ net::IPEndPoint remote_addr,
+ scoped_ptr<Client> transport_client,
+ base::TimeDelta transport_logging_flush_interval,
+ scoped_ptr<base::DictionaryValue> options,
+ const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
+ ~CreateParams();
+
+ net::NetLog* net_log;
+ base::TickClock* clock;
+ net::IPEndPoint local_end_point;
+ net::IPEndPoint remote_end_point;
+ scoped_ptr<Client> client;
+ base::TimeDelta logging_flush_interval;
+ scoped_ptr<base::DictionaryValue> optional_config;
imcheng 2015/12/17 00:18:10 If this is optional, can it be set via a setter()
xjz 2015/12/17 22:54:57 It is only used inside the constructor. I prefer l
+ const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner;
imcheng 2015/12/17 00:18:10 Did you mean scoped_refptr<base::SingleThreadTaskR
xjz 2015/12/17 22:54:57 Done.
+ };
+
+ static scoped_ptr<CastTransportSender> Create(const CreateParams& params);
virtual ~CastTransportSender() {}

Powered by Google App Engine
This is Rietveld 408576698