Move video-related MediaTransport interfaces to their own file and target

Bug: webrtc:9719
Change-Id: I2cf4a8520ce5c07c76ab0310cf7ab0ab285d9e0c
Reviewed-on: https://webrtc-review.googlesource.com/c/122504
Reviewed-by: Peter Slatala <psla@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26702}
diff --git a/api/media_transport_interface.h b/api/media_transport_interface.h
index c289d99..2f5431f 100644
--- a/api/media_transport_interface.h
+++ b/api/media_transport_interface.h
@@ -21,14 +21,13 @@
 #include <memory>
 #include <string>
 #include <utility>
-#include <vector>
 
 #include "absl/types/optional.h"
 #include "api/array_view.h"
 #include "api/rtc_error.h"
 #include "api/transport/media/audio_transport.h"
+#include "api/transport/media/video_transport.h"
 #include "api/units/data_rate.h"
-#include "api/video/encoded_image.h"
 #include "rtc_base/copy_on_write_buffer.h"
 #include "rtc_base/network_route.h"
 
@@ -88,80 +87,6 @@
       const rtc::NetworkRoute& new_network_route) = 0;
 };
 
-// Represents encoded video frame, along with the codec information.
-class MediaTransportEncodedVideoFrame final {
- public:
-  MediaTransportEncodedVideoFrame(int64_t frame_id,
-                                  std::vector<int64_t> referenced_frame_ids,
-                                  int payload_type,
-                                  const webrtc::EncodedImage& encoded_image);
-  ~MediaTransportEncodedVideoFrame();
-  MediaTransportEncodedVideoFrame(const MediaTransportEncodedVideoFrame&);
-  MediaTransportEncodedVideoFrame& operator=(
-      const MediaTransportEncodedVideoFrame& other);
-  MediaTransportEncodedVideoFrame& operator=(
-      MediaTransportEncodedVideoFrame&& other);
-  MediaTransportEncodedVideoFrame(MediaTransportEncodedVideoFrame&&);
-
-  int payload_type() const { return payload_type_; }
-  const webrtc::EncodedImage& encoded_image() const { return encoded_image_; }
-
-  int64_t frame_id() const { return frame_id_; }
-  const std::vector<int64_t>& referenced_frame_ids() const {
-    return referenced_frame_ids_;
-  }
-
-  // Hack to workaround lack of ownership of the EncodedImage buffer. If we
-  // don't already own the underlying data, make a copy.
-  void Retain() { encoded_image_.Retain(); }
-
- private:
-  MediaTransportEncodedVideoFrame();
-
-  int payload_type_;
-
-  // The buffer is not always owned by the encoded image. On the sender it means
-  // that it will need to make a copy using the Retain() method, if it wants to
-  // deliver it asynchronously.
-  webrtc::EncodedImage encoded_image_;
-
-  // Frame id uniquely identifies a frame in a stream. It needs to be unique in
-  // a given time window (i.e. technically unique identifier for the lifetime of
-  // the connection is not needed, but you need to guarantee that remote side
-  // got rid of the previous frame_id if you plan to reuse it).
-  //
-  // It is required by a remote jitter buffer, and is the same as
-  // EncodedFrame::id::picture_id.
-  //
-  // This data must be opaque to the media transport, and media transport should
-  // itself not make any assumptions about what it is and its uniqueness.
-  int64_t frame_id_;
-
-  // A single frame might depend on other frames. This is set of identifiers on
-  // which the current frame depends.
-  std::vector<int64_t> referenced_frame_ids_;
-};
-
-// Interface for receiving encoded video frames from MediaTransportInterface
-// implementations.
-class MediaTransportVideoSinkInterface {
- public:
-  virtual ~MediaTransportVideoSinkInterface() = default;
-
-  // Called when new encoded video frame is received.
-  virtual void OnData(uint64_t channel_id,
-                      MediaTransportEncodedVideoFrame frame) = 0;
-};
-
-// Interface for video sender to be notified of received key frame request.
-class MediaTransportKeyFrameRequestCallback {
- public:
-  virtual ~MediaTransportKeyFrameRequestCallback() = default;
-
-  // Called when a key frame request is received on the transport.
-  virtual void OnKeyFrameRequested(uint64_t channel_id) = 0;
-};
-
 // State of the media transport.  Media transport begins in the pending state.
 // It transitions to writable when it is ready to send media.  It may transition
 // back to pending if the connection is blocked.  It may transition to closed at