2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.Runtime.InteropServices;
20 namespace Tizen.Multimedia
22 internal static partial class Interop
24 internal static class MediaPacket
26 [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_create")]
27 internal static extern int Create(IntPtr format, IntPtr finalizeCb, IntPtr cbData, out IntPtr handle);
29 [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_alloc")]
30 internal static extern int Alloc(IntPtr handle);
32 [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_destroy")]
33 internal static extern int Destroy(IntPtr handle);
35 [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_format")]
36 internal static extern int GetFormat(IntPtr handle, out IntPtr format);
38 [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_buffer_data_ptr")]
39 internal static extern int GetBufferData(IntPtr handle, out IntPtr dataHandle);
41 [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_buffer_size")]
42 internal static extern int GetBufferSize(IntPtr handle, out ulong size);
44 [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_set_buffer_size")]
45 internal static extern int SetBufferSize(IntPtr handle, ulong size);
47 [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_allocated_buffer_size")]
48 internal static extern int GetAllocatedBufferSize(IntPtr handle, out int size);
50 [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_number_of_video_planes")]
51 internal static extern int GetNumberOfVideoPlanes(IntPtr handle, out uint num);
53 [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_video_stride_width")]
54 internal static extern int GetVideoStrideWidth(IntPtr handle, int planeIndex, out int value);
56 [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_video_stride_height")]
57 internal static extern int GetVideoStrideHeight(IntPtr handle, int planeIndex, out int value);
59 [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_video_plane_data_ptr")]
60 internal static extern int GetVideoPlaneData(IntPtr handle, int planeIndex, out IntPtr dataHandle);
62 [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_is_encoded")]
63 internal static extern int IsEncoded(IntPtr handle, out bool value);
65 [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_flags")]
66 internal static extern int GetBufferFlags(IntPtr handle, out int value);
68 [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_set_flags")]
69 internal static extern int SetBufferFlags(IntPtr handle, int value);
71 [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_reset_flags")]
72 internal static extern int ResetBufferFlags(IntPtr handle);
74 [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_pts")]
75 internal static extern int GetPts(IntPtr handle, out ulong value);
77 [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_dts")]
78 internal static extern int GetDts(IntPtr handle, out ulong value);
80 [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_set_pts")]
81 internal static extern int SetPts(IntPtr handle, ulong value);
83 [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_set_dts")]
84 internal static extern int SetDts(IntPtr handle, ulong value);
87 [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_set_extra")]
88 internal static extern int SetExtra(IntPtr handle, IntPtr value);
90 [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_extra")]
91 internal static extern int GetExtra(IntPtr handle, out IntPtr value);
94 internal static class MediaFormat
96 [DllImport(Libraries.MediaTool, EntryPoint = "media_format_create")]
97 internal static extern int Create(out IntPtr handle);
99 [DllImport(Libraries.MediaTool, EntryPoint = "media_format_unref")]
100 internal static extern int Unref(IntPtr handle);
102 [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_type")]
103 internal static extern int GetType(IntPtr handle, out int type);
105 [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_container_mime")]
106 internal static extern int GetContainerMimeType(IntPtr handle, out int mimeType);
108 [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_container_mime")]
109 internal static extern int SetContainerMimeType(IntPtr handle, int mimeType);
112 [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_video_info")]
113 internal static extern int GetVideoInfo(IntPtr handle, out int mimeType,
114 out int width, out int height, out int averageBps, out int maxBps);
116 [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_video_frame_rate")]
117 internal static extern int GetVideoFrameRate(IntPtr handle, out int frameRate);
119 [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_video_mime")]
120 internal static extern int SetVideoMimeType(IntPtr handle, int value);
122 [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_video_width")]
123 internal static extern int SetVideoWidth(IntPtr handle, int value);
125 [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_video_height")]
126 internal static extern int SetVideoHeight(IntPtr handle, int value);
128 [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_video_avg_bps")]
129 internal static extern int SetVideoAverageBps(IntPtr handle, int value);
131 [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_video_frame_rate")]
132 internal static extern int SetVideoFrameRate(IntPtr handle, int value);
136 [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_audio_info")]
137 internal static extern int GetAudioInfo(IntPtr handle, out int mimeType,
138 out int channel, out int sampleRate, out int bit, out int averageBps);
140 [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_audio_aac_header_type")]
141 internal static extern int GetAudioAacType(IntPtr handle, out int aacType);
143 [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_audio_mime")]
144 internal static extern int SetAudioMimeType(IntPtr handle, int value);
146 [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_audio_channel")]
147 internal static extern int SetAudioChannel(IntPtr handle, int value);
149 [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_audio_samplerate")]
150 internal static extern int SetAudioSampleRate(IntPtr handle, int value);
152 [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_audio_bit")]
153 internal static extern int SetAudioBit(IntPtr handle, int value);
155 [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_audio_avg_bps")]
156 internal static extern int SetAudioAverageBps(IntPtr handle, int value);
158 [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_audio_aac_header_type")]
159 internal static extern int SetAudioAacType(IntPtr handle, int value);
162 [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_text_info")]
163 internal static extern int GetTextInfo(IntPtr handle, out int mimeType, out int textType);
165 [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_text_mime")]
166 internal static extern int SetTextMimeType(IntPtr handle, int value);
168 [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_text_type")]
169 internal static extern int SetTextType(IntPtr handle, int value);