summaryrefslogtreecommitdiff
path: root/chromium/components/mirroring/service/interface.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/components/mirroring/service/interface.h')
-rw-r--r--chromium/components/mirroring/service/interface.h74
1 files changed, 49 insertions, 25 deletions
diff --git a/chromium/components/mirroring/service/interface.h b/chromium/components/mirroring/service/interface.h
index 501280efa0f..3feac5c3edb 100644
--- a/chromium/components/mirroring/service/interface.h
+++ b/chromium/components/mirroring/service/interface.h
@@ -5,13 +5,10 @@
#ifndef COMPONENTS_MIRRORING_SERVICE_INTERFACE_H_
#define COMPONENTS_MIRRORING_SERVICE_INTERFACE_H_
-#include <vector>
+#include <string>
-#include "base/callback.h"
-#include "base/values.h"
#include "media/capture/mojom/video_capture.mojom.h"
-#include "media/cast/cast_config.h"
-#include "net/base/ip_endpoint.h"
+#include "net/base/ip_address.h"
#include "services/network/public/mojom/network_service.mojom.h"
namespace mirroring {
@@ -21,22 +18,55 @@ namespace mirroring {
// Errors occurred in a mirroring session.
enum SessionError {
- SESSION_START_ERROR, // Error occurred while starting.
- AUDIO_CAPTURE_ERROR, // Error occurred in audio capturing.
- VIDEO_CAPTURE_ERROR, // Error occurred in video capturing.
- CAST_STREAMING_ERROR, // Error occurred in cast streaming.
- CAST_TRANSPORT_ERROR, // Error occurred in cast transport.
+ ANSWER_TIME_OUT, // ANSWER timeout.
+ ANSWER_NOT_OK, // Not OK answer response.
+ ANSWER_MISMATCHED_CAST_MODE, // ANSWER cast mode mismatched.
+ ANSWER_MISMATCHED_SSRC_LENGTH, // ANSWER ssrc length mismatched with indexes.
+ ANSWER_SELECT_MULTIPLE_AUDIO, // Multiple audio streams selected by ANSWER.
+ ANSWER_SELECT_MULTIPLE_VIDEO, // Multiple video streams selected by ANSWER.
+ ANSWER_SELECT_INVALID_INDEX, // Invalid index was selected.
+ ANSWER_NO_AUDIO_OR_VIDEO, // ANSWER not select audio or video.
+ AUDIO_CAPTURE_ERROR, // Error occurred in audio capturing.
+ VIDEO_CAPTURE_ERROR, // Error occurred in video capturing.
+ RTP_STREAM_ERROR, // Error reported by RtpStream.
+ ENCODING_ERROR, // Error occurred in encoding.
+ CAST_TRANSPORT_ERROR, // Error occurred in cast transport.
};
-enum SessionType {
+enum DeviceCapability {
AUDIO_ONLY,
VIDEO_ONLY,
AUDIO_AND_VIDEO,
};
-class SessionClient {
+constexpr char kRemotingNamespace[] = "urn:x-cast:com.google.cast.remoting";
+constexpr char kWebRtcNamespace[] = "urn:x-cast:com.google.cast.webrtc";
+
+struct CastMessage {
+ std::string message_namespace;
+ std::string json_format_data; // The content of the message.
+};
+
+class CastMessageChannel {
public:
- virtual ~SessionClient() {}
+ virtual ~CastMessageChannel() {}
+ virtual void Send(const CastMessage& message) = 0;
+};
+
+struct CastSinkInfo {
+ CastSinkInfo();
+ ~CastSinkInfo();
+ CastSinkInfo(const CastSinkInfo& sink_info);
+
+ net::IPAddress ip_address;
+ std::string model_name;
+ std::string friendly_name;
+ DeviceCapability capability;
+};
+
+class SessionObserver {
+ public:
+ virtual ~SessionObserver() {}
// Called when error occurred. The session will be stopped.
virtual void OnError(SessionError error) = 0;
@@ -46,25 +76,19 @@ class SessionClient {
// Called when the session is stopped.
virtual void DidStop() = 0;
+};
+
+class ResourceProvider {
+ public:
+ virtual ~ResourceProvider() {}
virtual void GetVideoCaptureHost(
media::mojom::VideoCaptureHostRequest request) = 0;
- virtual void GetNewWorkContext(
+ virtual void GetNetworkContext(
network::mojom::NetworkContextRequest request) = 0;
// TODO(xjz): Add interface to get AudioCaptureHost.
// TODO(xjz): Add interface for HW encoder profiles query and VEA create
// support.
-
- // TODO(xjz): Change this with an interface to send/receive messages to/from
- // receiver through cast channel, and generate/parse the OFFER/ANSWER message
- // in Mirroing service.
- using GetAnswerCallback = base::OnceCallback<void(
- const media::cast::FrameSenderConfig& audio_config,
- const media::cast::FrameSenderConfig& video_config)>;
- virtual void DoOfferAnswerExchange(
- const std::vector<media::cast::FrameSenderConfig>& audio_configs,
- const std::vector<media::cast::FrameSenderConfig>& video_configs,
- GetAnswerCallback callback) = 0;
};
} // namespace mirroring