40 static PRLogModuleInfo* gMediacoreCapabilities = nsnull;
41 #define TRACE(args) PR_LOG(gMediacoreCapabilities , PR_LOG_DEBUG, args)
42 #define LOG(args) PR_LOG(gMediacoreCapabilities , PR_LOG_WARN, args)
53 , mSupportsAudioPlayback(PR_FALSE)
54 , mSupportsVideoPlayback(PR_FALSE)
55 , mSupportsImagePlayback(PR_FALSE)
56 , mSupportsAudioTranscode(PR_FALSE)
57 , mSupportsVideoTranscode(PR_FALSE)
58 , mSupportsImageTranscode(PR_FALSE)
63 if (!gMediacoreCapabilities)
64 gMediacoreCapabilities = PR_NewLogModule(
"sbMediacoreCapabilities");
67 TRACE((
"sbMediacoreCapabilities[0x%x] - Created",
this));
72 TRACE((
"sbMediacoreCapabilities[0x%x] - Destroyed",
this));
77 nsAutoLock::DestroyLock(
mLock);
84 TRACE((
"sbMediacoreCapabilities[0x%x] - Init",
this));
86 mLock = nsAutoLock::NewLock(
"sbMediacoreCapabilities::mLock");
87 NS_ENSURE_TRUE(
mLock, NS_ERROR_OUT_OF_MEMORY);
94 const sbStringArray &aAudioExtensions)
96 TRACE((
"sbMediacoreCapabilities[0x%x] - SetAudioExtensions",
this));
98 NS_ENSURE_TRUE(
mLock, NS_ERROR_NOT_INITIALIZED);
100 nsAutoLock lock(
mLock);
108 const sbStringArray &aVideoExtensions)
110 TRACE((
"sbMediacoreCapabilities[0x%x] - SetVideoExtensions",
this));
112 NS_ENSURE_TRUE(
mLock, NS_ERROR_NOT_INITIALIZED);
114 nsAutoLock lock(
mLock);
122 const sbStringArray &aImageExtensions)
124 TRACE((
"sbMediacoreCapabilities[0x%x] - SetImageExtensions",
this));
126 NS_ENSURE_TRUE(
mLock, NS_ERROR_NOT_INITIALIZED);
128 nsAutoLock lock(
mLock);
137 TRACE((
"sbMediacoreCapabilities[0x%x] - SetSupportsAudioPlayback",
this));
139 NS_ENSURE_TRUE(
mLock, NS_ERROR_NOT_INITIALIZED);
141 nsAutoLock lock(
mLock);
150 TRACE((
"sbMediacoreCapabilities[0x%x] - SetSupportsVideoPlayback",
this));
152 NS_ENSURE_TRUE(
mLock, NS_ERROR_NOT_INITIALIZED);
154 nsAutoLock lock(
mLock);
163 TRACE((
"sbMediacoreCapabilities[0x%x] - SetSupportsImagePlayback",
this));
165 NS_ENSURE_TRUE(
mLock, NS_ERROR_NOT_INITIALIZED);
167 nsAutoLock lock(
mLock);
176 TRACE((
"sbMediacoreCapabilities[0x%x] - SetSupportsAudioTranscode",
this));
178 NS_ENSURE_TRUE(
mLock, NS_ERROR_NOT_INITIALIZED);
180 nsAutoLock lock(
mLock);
189 TRACE((
"sbMediacoreCapabilities[0x%x] - SetSupportsVideoTranscode",
this));
191 NS_ENSURE_TRUE(
mLock, NS_ERROR_NOT_INITIALIZED);
193 nsAutoLock lock(
mLock);
202 TRACE((
"sbMediacoreCapabilities[0x%x] - SetSupportsImageTranscode",
this));
204 NS_ENSURE_TRUE(
mLock, NS_ERROR_NOT_INITIALIZED);
206 nsAutoLock lock(
mLock);
215 TRACE((
"sbMediacoreCapabilities[0x%x] - GetAudioExtensions",
this));
217 NS_ENSURE_ARG_POINTER(aAudioExtensions);
218 NS_ENSURE_TRUE(
mLock, NS_ERROR_NOT_INITIALIZED);
220 nsAutoLock lock(
mLock);
223 NS_ENSURE_TRUE(audioExtensions, NS_ERROR_OUT_OF_MEMORY);
225 audioExtensions.forget(aAudioExtensions);
233 TRACE((
"sbMediacoreCapabilities[0x%x] - GetVideoExtensions",
this));
235 NS_ENSURE_ARG_POINTER(aVideoExtensions);
236 NS_ENSURE_TRUE(
mLock, NS_ERROR_NOT_INITIALIZED);
238 nsAutoLock lock(
mLock);
241 NS_ENSURE_TRUE(videoExtensions, NS_ERROR_OUT_OF_MEMORY);
243 videoExtensions.forget(aVideoExtensions);
251 TRACE((
"sbMediacoreCapabilities[0x%x] - GetImageExtensions",
this));
253 NS_ENSURE_ARG_POINTER(aImageExtensions);
254 NS_ENSURE_TRUE(
mLock, NS_ERROR_NOT_INITIALIZED);
256 nsAutoLock lock(
mLock);
259 NS_ENSURE_TRUE(imageExtensions, NS_ERROR_OUT_OF_MEMORY);
261 imageExtensions.forget(aImageExtensions);
267 sbMediacoreCapabilities::GetSupportsAudioPlayback(PRBool *aSupportsAudioPlayback)
269 TRACE((
"sbMediacoreCapabilities[0x%x] - GetSupportsAudioPlayback",
this));
271 NS_ENSURE_ARG_POINTER(aSupportsAudioPlayback);
272 NS_ENSURE_TRUE(
mLock, NS_ERROR_NOT_INITIALIZED);
274 nsAutoLock lock(
mLock);
281 sbMediacoreCapabilities::GetSupportsVideoPlayback(PRBool *aSupportsVideoPlayback)
283 TRACE((
"sbMediacoreCapabilities[0x%x] - GetSupportsVideoPlayback",
this));
285 NS_ENSURE_ARG_POINTER(aSupportsVideoPlayback);
286 NS_ENSURE_TRUE(
mLock, NS_ERROR_NOT_INITIALIZED);
288 nsAutoLock lock(
mLock);
295 sbMediacoreCapabilities::GetSupportsImagePlayback(PRBool *aSupportsImagePlayback)
297 TRACE((
"sbMediacoreCapabilities[0x%x] - GetSupportsImagePlayback",
this));
299 NS_ENSURE_ARG_POINTER(aSupportsImagePlayback);
300 NS_ENSURE_TRUE(
mLock, NS_ERROR_NOT_INITIALIZED);
302 nsAutoLock lock(
mLock);
309 sbMediacoreCapabilities::GetSupportsAudioTranscode(PRBool *aSupportsAudioTranscode)
311 TRACE((
"sbMediacoreCapabilities[0x%x] - GetSupportsAudioTranscode",
this));
313 NS_ENSURE_ARG_POINTER(aSupportsAudioTranscode);
314 NS_ENSURE_TRUE(
mLock, NS_ERROR_NOT_INITIALIZED);
316 nsAutoLock lock(
mLock);
323 sbMediacoreCapabilities::GetSupportsVideoTranscode(PRBool *aSupportsVideoTranscode)
325 TRACE((
"sbMediacoreCapabilities[0x%x] - GetSupportsVideoTranscode",
this));
327 NS_ENSURE_ARG_POINTER(aSupportsVideoTranscode);
328 NS_ENSURE_TRUE(
mLock, NS_ERROR_NOT_INITIALIZED);
330 nsAutoLock lock(
mLock);
337 sbMediacoreCapabilities::GetSupportsImageTranscode(PRBool *aSupportsImageTranscode)
339 TRACE((
"sbMediacoreCapabilities[0x%x] - GetSupportsImageTranscode",
this));
341 NS_ENSURE_ARG_POINTER(aSupportsImageTranscode);
342 NS_ENSURE_TRUE(
mLock, NS_ERROR_NOT_INITIALIZED);
344 nsAutoLock lock(
mLock);