| 1 |
/* |
| 2 |
* Copyright (C) 2025 Mohamad Al-Jaf |
| 3 |
* |
| 4 |
* This library is free software; you can redistribute it and/or |
| 5 |
* modify it under the terms of the GNU Lesser General Public |
| 6 |
* License as published by the Free Software Foundation; either |
| 7 |
* version 2.1 of the License, or (at your option) any later version. |
| 8 |
* |
| 9 |
* This library is distributed in the hope that it will be useful, |
| 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 |
* Lesser General Public License for more details. |
| 13 |
* |
| 14 |
* You should have received a copy of the GNU Lesser General Public |
| 15 |
* License along with this library; if not, write to the Free Software |
| 16 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA |
| 17 |
*/ |
| 18 |
|
| 19 |
#ifdef __WIDL__ |
| 20 |
#pragma winrt ns_prefix |
| 21 |
#endif |
| 22 |
|
| 23 |
import "inspectable.idl"; |
| 24 |
import "asyncinfo.idl"; |
| 25 |
import "eventtoken.idl"; |
| 26 |
import "windowscontracts.idl"; |
| 27 |
import "windows.foundation.idl"; |
| 28 |
import "windows.media.core.idl"; |
| 29 |
import "windows.media.mediaproperties.idl"; |
| 30 |
import "windows.storage.idl"; |
| 31 |
import "windows.storage.streams.idl"; |
| 32 |
|
| 33 |
namespace Windows.Media.Transcoding { |
| 34 |
typedef enum MediaVideoProcessingAlgorithm MediaVideoProcessingAlgorithm; |
| 35 |
typedef enum TranscodeFailureReason TranscodeFailureReason; |
| 36 |
|
| 37 |
interface IMediaTranscoder; |
| 38 |
interface IMediaTranscoder2; |
| 39 |
interface IPrepareTranscodeResult; |
| 40 |
|
| 41 |
runtimeclass MediaTranscoder; |
| 42 |
runtimeclass PrepareTranscodeResult; |
| 43 |
|
| 44 |
declare { |
| 45 |
interface Windows.Foundation.IAsyncActionWithProgress<DOUBLE>; |
| 46 |
interface Windows.Foundation.AsyncActionProgressHandler<DOUBLE>; |
| 47 |
interface Windows.Foundation.AsyncActionWithProgressCompletedHandler<DOUBLE>; |
| 48 |
interface Windows.Foundation.IAsyncOperation<Windows.Media.Transcoding.PrepareTranscodeResult *>; |
| 49 |
interface Windows.Foundation.IAsyncOperation<Windows.Media.Transcoding.TranscodeFailureReason>; |
| 50 |
interface Windows.Foundation.IAsyncOperationWithProgress<Windows.Media.Transcoding.TranscodeFailureReason, DOUBLE>; |
| 51 |
interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Media.Transcoding.PrepareTranscodeResult *>; |
| 52 |
interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Media.Transcoding.TranscodeFailureReason>; |
| 53 |
interface Windows.Foundation.AsyncOperationWithProgressCompletedHandler<Windows.Media.Transcoding.TranscodeFailureReason, DOUBLE>; |
| 54 |
interface Windows.Foundation.AsyncOperationProgressHandler<Windows.Media.Transcoding.TranscodeFailureReason, DOUBLE>; |
| 55 |
} |
| 56 |
|
| 57 |
[ |
| 58 |
contract(Windows.Foundation.UniversalApiContract, 1.0) |
| 59 |
] |
| 60 |
enum MediaVideoProcessingAlgorithm |
| 61 |
{ |
| 62 |
Default = 0, |
| 63 |
MrfCrf444 = 1, |
| 64 |
}; |
| 65 |
|
| 66 |
[ |
| 67 |
contract(Windows.Foundation.UniversalApiContract, 1.0) |
| 68 |
] |
| 69 |
enum TranscodeFailureReason |
| 70 |
{ |
| 71 |
None = 0, |
| 72 |
Unknown = 1, |
| 73 |
InvalidProfile = 2, |
| 74 |
CodecNotFound = 3, |
| 75 |
}; |
| 76 |
|
| 77 |
[ |
| 78 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 79 |
exclusiveto(Windows.Media.Transcoding.MediaTranscoder), |
| 80 |
uuid(190c99d2-a0aa-4d34-86bc-eed1b12c2f5b) |
| 81 |
] |
| 82 |
interface IMediaTranscoder : IInspectable |
| 83 |
{ |
| 84 |
[propput] HRESULT TrimStartTime([in] Windows.Foundation.TimeSpan value); |
| 85 |
[propget] HRESULT TrimStartTime([out, retval] Windows.Foundation.TimeSpan *value); |
| 86 |
[propput] HRESULT TrimStopTime([in] Windows.Foundation.TimeSpan value); |
| 87 |
[propget] HRESULT TrimStopTime([out, retval] Windows.Foundation.TimeSpan *value); |
| 88 |
[propput] HRESULT AlwaysReencode([in] boolean value); |
| 89 |
[propget] HRESULT AlwaysReencode([out, retval] boolean *value); |
| 90 |
[propput] HRESULT HardwareAccelerationEnabled([in] boolean value); |
| 91 |
[propget] HRESULT HardwareAccelerationEnabled([out, retval] boolean *value); |
| 92 |
[overload("AddAudioEffect")] HRESULT AddAudioEffect([in] HSTRING activatable_class_id); |
| 93 |
[overload("AddAudioEffect")] HRESULT AddAudioEffectWithSettings([in] HSTRING activatable_class_id, [in] boolean effect_required, [in] Windows.Foundation.Collections.IPropertySet *configuration); |
| 94 |
[overload("AddVideoEffect")] HRESULT AddVideoEffect([in] HSTRING activatable_class_id); |
| 95 |
[overload("AddVideoEffect")] HRESULT AddVideoEffectWithSettings([in] HSTRING activatable_class_id, [in] boolean effect_required, [in] Windows.Foundation.Collections.IPropertySet *configuration); |
| 96 |
HRESULT ClearEffects(); |
| 97 |
HRESULT PrepareFileTranscodeAsync([in] Windows.Storage.IStorageFile *source, [in] Windows.Storage.IStorageFile *destination, |
| 98 |
[in] Windows.Media.MediaProperties.MediaEncodingProfile *profile, |
| 99 |
[out, retval] Windows.Foundation.IAsyncOperation<Windows.Media.Transcoding.PrepareTranscodeResult *> **operation); |
| 100 |
HRESULT PrepareStreamTranscodeAsync([in] Windows.Storage.Streams.IRandomAccessStream *source, [in] Windows.Storage.Streams.IRandomAccessStream *destination, |
| 101 |
[in] Windows.Media.MediaProperties.MediaEncodingProfile *profile, |
| 102 |
[out, retval] Windows.Foundation.IAsyncOperation<Windows.Media.Transcoding.PrepareTranscodeResult *> **operation); |
| 103 |
} |
| 104 |
|
| 105 |
[ |
| 106 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 107 |
exclusiveto(Windows.Media.Transcoding.MediaTranscoder), |
| 108 |
uuid(40531d74-35e0-4f04-8574-ca8bc4e5a082) |
| 109 |
] |
| 110 |
interface IMediaTranscoder2 : IInspectable |
| 111 |
{ |
| 112 |
HRESULT PrepareMediaStreamSourceTranscodeAsync([in] Windows.Media.Core.IMediaSource *source, [in] Windows.Storage.Streams.IRandomAccessStream *destination, |
| 113 |
[in] Windows.Media.MediaProperties.MediaEncodingProfile *profile, |
| 114 |
[out, retval] Windows.Foundation.IAsyncOperation<Windows.Media.Transcoding.PrepareTranscodeResult *> **operation); |
| 115 |
[propput] HRESULT VideoProcessingAlgorithm([in] Windows.Media.Transcoding.MediaVideoProcessingAlgorithm value); |
| 116 |
[propget] HRESULT VideoProcessingAlgorithm([out, retval] Windows.Media.Transcoding.MediaVideoProcessingAlgorithm *value); |
| 117 |
} |
| 118 |
|
| 119 |
[ |
| 120 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 121 |
exclusiveto(Windows.Media.Transcoding.PrepareTranscodeResult), |
| 122 |
uuid(05f25dce-994f-4a34-9d68-97ccce1730d6) |
| 123 |
] |
| 124 |
interface IPrepareTranscodeResult : IInspectable |
| 125 |
{ |
| 126 |
[propget] HRESULT CanTranscode([out, retval] boolean *value); |
| 127 |
[propget] HRESULT FailureReason([out, retval] Windows.Media.Transcoding.TranscodeFailureReason *value); |
| 128 |
HRESULT TranscodeAsync([out, retval] Windows.Foundation.IAsyncActionWithProgress<DOUBLE> **operation); |
| 129 |
} |
| 130 |
|
| 131 |
[ |
| 132 |
activatable(Windows.Foundation.UniversalApiContract, 1.0), |
| 133 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 134 |
marshaling_behavior(agile), |
| 135 |
threading(both) |
| 136 |
] |
| 137 |
runtimeclass MediaTranscoder |
| 138 |
{ |
| 139 |
[default] interface Windows.Media.Transcoding.IMediaTranscoder; |
| 140 |
[contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Media.Transcoding.IMediaTranscoder2; |
| 141 |
} |
| 142 |
|
| 143 |
[ |
| 144 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 145 |
marshaling_behavior(agile), |
| 146 |
threading(both) |
| 147 |
] |
| 148 |
runtimeclass PrepareTranscodeResult |
| 149 |
{ |
| 150 |
[default] interface Windows.Media.Transcoding.IPrepareTranscodeResult; |
| 151 |
} |
| 152 |
} |