Fix compilation issues on media_transport_interface.h

Include api/video/encoded_image.h, and move constructors and
destructors to .cc file.

Bug: webrtc:9719
Change-Id: Ibecdc1151bf672155d3c09e13749ac39c921c3aa
Reviewed-on: https://webrtc-review.googlesource.com/c/104560
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25044}
diff --git a/api/BUILD.gn b/api/BUILD.gn
index 5b21334..5fdebc9 100644
--- a/api/BUILD.gn
+++ b/api/BUILD.gn
@@ -63,6 +63,7 @@
     "jsepicecandidate.cc",
     "jsepicecandidate.h",
     "jsepsessiondescription.h",
+    "media_transport_interface.cc",
     "media_transport_interface.h",
     "mediaconstraintsinterface.cc",
     "mediaconstraintsinterface.h",
@@ -109,6 +110,7 @@
     "audio_codecs:audio_codecs_api",
     "transport:bitrate_settings",
     "transport:network_control",
+    "video:encoded_image",
     "video:video_frame",
     "//third_party/abseil-cpp/absl/types:optional",
 
diff --git a/api/media_transport_interface.cc b/api/media_transport_interface.cc
new file mode 100644
index 0000000..13bc982
--- /dev/null
+++ b/api/media_transport_interface.cc
@@ -0,0 +1,52 @@
+/*
+ *  Copyright 2018 The WebRTC project authors. All Rights Reserved.
+ *
+ *  Use of this source code is governed by a BSD-style license
+ *  that can be found in the LICENSE file in the root of the source
+ *  tree. An additional intellectual property rights grant can be found
+ *  in the file PATENTS.  All contributing project authors may
+ *  be found in the AUTHORS file in the root of the source tree.
+ */
+
+// This is EXPERIMENTAL interface for media transport.
+//
+// The goal is to refactor WebRTC code so that audio and video frames
+// are sent / received through the media transport interface. This will
+// enable different media transport implementations, including QUIC-based
+// media transport.
+
+#include "api/media_transport_interface.h"
+
+namespace webrtc {
+
+MediaTransportEncodedAudioFrame::MediaTransportEncodedAudioFrame(
+    int sampling_rate_hz,
+    int starting_sample_index,
+    int samples_per_channel,
+    int sequence_number,
+    FrameType frame_type,
+    uint8_t payload_type,
+    std::vector<uint8_t> encoded_data)
+    : sampling_rate_hz_(sampling_rate_hz),
+      starting_sample_index_(starting_sample_index),
+      samples_per_channel_(samples_per_channel),
+      sequence_number_(sequence_number),
+      frame_type_(frame_type),
+      payload_type_(payload_type),
+      encoded_data_(std::move(encoded_data)) {}
+
+MediaTransportEncodedAudioFrame::~MediaTransportEncodedAudioFrame() = default;
+
+MediaTransportEncodedVideoFrame::MediaTransportEncodedVideoFrame(
+    int64_t frame_id,
+    std::vector<int64_t> referenced_frame_ids,
+    VideoCodecType codec_type,
+    const webrtc::EncodedImage& encoded_image)
+    : codec_type_(codec_type),
+      encoded_image_(encoded_image),
+      frame_id_(frame_id),
+      referenced_frame_ids_(std::move(referenced_frame_ids)) {}
+
+MediaTransportEncodedVideoFrame::~MediaTransportEncodedVideoFrame() = default;
+
+}  // namespace webrtc
diff --git a/api/media_transport_interface.h b/api/media_transport_interface.h
index 2c88cd4..154fe4a 100644
--- a/api/media_transport_interface.h
+++ b/api/media_transport_interface.h
@@ -23,6 +23,7 @@
 #include <vector>
 
 #include "api/rtcerror.h"
+#include "api/video/encoded_image.h"
 #include "common_types.h"  // NOLINT(build/include)
 
 namespace rtc {
@@ -75,14 +76,9 @@
       uint8_t payload_type,
 
       // Vector with opaque encoded data.
-      std::vector<uint8_t> encoded_data)
-      : sampling_rate_hz_(sampling_rate_hz),
-        starting_sample_index_(starting_sample_index),
-        samples_per_channel_(samples_per_channel),
-        sequence_number_(sequence_number),
-        frame_type_(frame_type),
-        payload_type_(payload_type),
-        encoded_data_(std::move(encoded_data)) {}
+      std::vector<uint8_t> encoded_data);
+
+  ~MediaTransportEncodedAudioFrame();
 
   // Getters.
   int sampling_rate_hz() const { return sampling_rate_hz_; }
@@ -130,11 +126,8 @@
   MediaTransportEncodedVideoFrame(int64_t frame_id,
                                   std::vector<int64_t> referenced_frame_ids,
                                   VideoCodecType codec_type,
-                                  const webrtc::EncodedImage& encoded_image)
-      : codec_type_(codec_type),
-        encoded_image_(encoded_image),
-        frame_id_(frame_id),
-        referenced_frame_ids_(std::move(referenced_frame_ids)) {}
+                                  const webrtc::EncodedImage& encoded_image);
+  ~MediaTransportEncodedVideoFrame();
 
   VideoCodecType codec_type() const { return codec_type_; }
   const webrtc::EncodedImage& encoded_image() const { return encoded_image_; }