[MediaPlayer] Add API to export audio PCM data (#930)
[platform/core/csapi/tizenfx.git] / src / Tizen.Multimedia.MediaPlayer / Interop / Interop.Player.cs
index d0eeab1..8c0cf7a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
@@ -37,6 +37,9 @@ internal static partial class Interop
         internal delegate void VideoFrameDecodedCallback(IntPtr packetHandle, IntPtr userData);
 
         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+        internal delegate void AudioFrameDecodedCallback(IntPtr packetHandle, IntPtr userData);
+
+        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
         internal delegate void SubtitleUpdatedCallback(uint duration, string text, IntPtr userData);
 
         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
@@ -121,6 +124,13 @@ internal static partial class Interop
         internal static extern PlayerErrorCode SetPlayPosition(IntPtr player, int millisecond,
             bool accurate, SeekCompletedCallback cb, IntPtr userData = default(IntPtr));
 
+        [DllImport(Libraries.Player, EntryPoint = "player_get_play_position_nsec")]
+        internal static extern PlayerErrorCode GetPlayPositionNanoseconds(IntPtr player, out long nanoseconds);
+
+        [DllImport(Libraries.Player, EntryPoint = "player_set_play_position_nsec")]
+        internal static extern PlayerErrorCode SetPlayPositionNanoseconds(IntPtr player, long nanoseconds,
+            bool accurate, SeekCompletedCallback cb, IntPtr userData = default(IntPtr));
+
         [DllImport(Libraries.Player, EntryPoint = "player_set_mute")]
         internal static extern PlayerErrorCode SetMute(IntPtr player, bool muted);
 
@@ -165,6 +175,13 @@ internal static partial class Interop
         [DllImport(Libraries.Player, EntryPoint = "player_unset_media_packet_video_frame_decoded_cb")]
         internal static extern PlayerErrorCode UnsetVideoFrameDecodedCb(IntPtr player);
 
+        [DllImport(Libraries.Player, EntryPoint = "player_set_media_packet_audio_frame_decoded_cb")]
+        internal static extern PlayerErrorCode SetAudioFrameDecodedCb(IntPtr player, IntPtr format, PlayerAudioExtractOption opt,
+            AudioFrameDecodedCallback callback, IntPtr userData = default(IntPtr));
+
+        [DllImport(Libraries.Player, EntryPoint = "player_unset_media_packet_audio_frame_decoded_cb")]
+        internal static extern PlayerErrorCode UnsetAudioFrameDecodedCb(IntPtr player);
+
         [DllImport(Libraries.Player, EntryPoint = "player_set_streaming_cookie")]
         internal static extern PlayerErrorCode SetStreamingCookie(IntPtr player, string cookie, int size);
 
@@ -243,6 +260,9 @@ internal static partial class Interop
         [DllImport(Libraries.Player, EntryPoint = "player_get_duration")]
         internal static extern PlayerErrorCode GetDuration(IntPtr player, out int duration);
 
+        [DllImport(Libraries.Player, EntryPoint = "player_get_duration_nsec")]
+        internal static extern PlayerErrorCode GetDurationNanoseconds(IntPtr player, out long duration);
+
         [DllImport(Libraries.Player, EntryPoint = "player_set_subtitle_path")]
         internal static extern PlayerErrorCode SetSubtitlePath(IntPtr player, string path);
 
@@ -321,6 +341,24 @@ internal static partial class Interop
 
         [DllImport(Libraries.Player, EntryPoint = "player_get_max_adaptive_variant_limit")]
         internal static extern PlayerErrorCode GetMaxLimit(IntPtr player, out int bandwidth, out int width, out int height);
+
+        [DllImport(Libraries.Player, EntryPoint = "player_set_video_roi_area")]
+        internal static extern PlayerErrorCode SetVideoRoi(IntPtr player, double scaleX, double scaleY, double scaleWidth, double scaleHeight);
+
+        [DllImport(Libraries.Player, EntryPoint = "player_get_video_roi_area")]
+        internal static extern PlayerErrorCode GetVideoRoi(IntPtr player, out double scaleX, out double scaleY, out double scaleWidth, out double scaleHeight);
+
+        [DllImport(Libraries.Player, EntryPoint = "player_audio_pitch_set_enabled")]
+        internal static extern PlayerErrorCode SetAudioPitchEnabled(IntPtr player, bool enabled);
+
+        [DllImport(Libraries.Player, EntryPoint = "player_audio_pitch_is_enabled")]
+        internal static extern PlayerErrorCode IsAudioPitchEnabled(IntPtr player, out bool enabled);
+
+        [DllImport(Libraries.Player, EntryPoint = "player_audio_pitch_set_value")]
+        internal static extern PlayerErrorCode SetAudioPitch(IntPtr player, float level);
+
+        [DllImport(Libraries.Player, EntryPoint = "player_audio_pitch_get_value")]
+        internal static extern PlayerErrorCode GetAudioPitch(IntPtr player, out float level);
     }
 
     internal class PlayerHandle : SafeHandle