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

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

Issue 109413004: Cast:Adding cast_transport_config and cleaning up (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updating chrome/renderer Created 7 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/transport/cast_transport_sender.h
diff --git a/media/cast/transport/cast_transport_sender.h b/media/cast/transport/cast_transport_sender.h
index 5cfb40d0605ffcf6eab2fc5e80470f2cacf23725..db36dc5aee67d173cf60b28eb9f4da309f5e0e5c 100644
--- a/media/cast/transport/cast_transport_sender.h
+++ b/media/cast/transport/cast_transport_sender.h
@@ -1,10 +1,10 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-//
-// This is the main interface for the cast net sender. The cast sender handles
-// the cast pipeline from encoded frames (both audio and video), to encryption,
-// packetization and transport.
+
+// This is the main interface for the cast transport sender. The cast sender
+// handles the cast pipeline from encoded frames (both audio and video), to
+// encryption, packetization and transport.
// All configurations are done at creation.
#ifndef MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_
@@ -13,7 +13,7 @@
#include "base/basictypes.h"
#include "base/threading/non_thread_safe.h"
#include "base/time/tick_clock.h"
-#include "media/cast/net/cast_transport_defines.h"
+#include "media/cast/transport/cast_transport_defines.h"
namespace media {
class AudioBus;
@@ -24,46 +24,53 @@ namespace media {
namespace cast {
namespace transport {
-class CastNetNotification {
- public:
- enum CastNetStatus {
- UNINITIALIZED,
- INITIALIZED,
- INVALID_CRYPTO_CONFIG,
- SOCKET_ERROR,
- // TODO(mikhal): Add.
- };
-
- virtual void NotifyStatusChange(CastNetStatus result) = 0;
- virtual ~CastNetNotification() {}
-};
+typedef base::Callback<void(CastTransportStatus status)>
+ CastTransportStatusCallback;
// This Class is not thread safe.
-// The application should only trigger this class from one thread.
-class CastNetSender : public base::NonThreadSafe {
+// The application should only trigger this class from the transport thread.
+class CastTransportSender : public base::NonThreadSafe {
public:
- static CastNetSender* CreateCastNetSender(
+ static CastTransportSender* CreateCastNetSender(
base::TickClock* clock,
- const CastNetConfig& config,
- CastNetNotification* const notifier,
- scoped_refptr<PacketReceiver> packet_receiver);
+ const CastTransportConfig& config,
+ const CastTransportStatusCallback& status_callback,
+ scoped_refptr<base::TaskRunner> transport_thread);
+
+ virtual ~CastTransportSender() {}
- virtual ~CastNetSender() {}
- virtual void InsertCodedAudioFrame(const AudioBus* audio_bus,
+ // Sets the Cast packet receiver. Should be called after creation on the
+ // Cast sender.
+ virtual void SetPacketReceiver(
+ scoped_refptr<PacketReceiver> packet_receiver) = 0;
+
+ // The following two functions handle the encoded media frames (audio and
+ // video) to be processed.
+ // Frames will be encrypted, packetized and transmitted to the network.
+ virtual void InsertCodedAudioFrame(const EncodedAudioFrame* audio_frame,
const base::TimeTicks& recorded_time) = 0;
virtual void InsertCodedVideoFrame(const EncodedVideoFrame* video_frame,
const base::TimeTicks& capture_time) = 0;
+ // Builds an RTCP packet and sends it to the network.
virtual void SendRtcpFromRtpSender(
uint32 packet_type_flags,
const RtcpSenderInfo& sender_info,
const RtcpDlrrReportBlock& dlrr,
const RtcpSenderLogMessage& sender_log) = 0;
+ // Retransmision request.
virtual void ResendPackets(
const MissingFramesAndPacketsMap& missing_packets) = 0;
-};
+
+ // Retrieves audio RTP statistics.
+ virtual void RtpAudioStatistics(const base::TimeTicks& now,
+ RtcpSenderInfo* sender_info) = 0;
+
+ // Retrieves audio RTP statistics.
+ virtual void RtpVideoStatistics(const base::TimeTicks& now,
+ RtcpSenderInfo* sender_info) = 0;
} // namespace transport
} // namespace cast

Powered by Google App Engine
This is Rietveld 408576698