GNOME Bugzilla – Bug 524659
Add specific error code for encrypted streams (e.g. WMA/AAC DRM)
Last modified: 2008-04-09 17:49:04 UTC
There is no specific error code for encrypted streams, even though asfdemux and qtdemux can detect such streams (it could be useful when e.g. deciding whether to import streams into a user's music library in a media player, or to test programmatically whether a file can be played before playing it (when e.g. reading its metadata before playing it back). Currently a stream-decode error is issued in such cases which can not be differentiated from genuine stream errors such as bad data. The attached patches (one for gst-core one for gst-plugins-good and one for -ugly) add the needed functionality to -core (STREAM_ERROR_STREAM_ENCRYPTED error) and make asfdemux and qtdemux use the functionality (supposedly real streams can be encrypted too but searching the code i couldn't find where this is being detected).
Created attachment 108113 [details] [review] Patch for gst-core to add the stream-encrypted error
Created attachment 108114 [details] [review] Patch for -ugly to make asfdemux use the new error type
Created attachment 108115 [details] [review] Patch for -good to make qtdemux use the new error type
Created attachment 108116 [details] [review] Patch for -ugly to make asfdemux use the new error type (fixed) The previous version used the wrong name for the asfdemux-object's self variable within the parse_stream_object member function.
The message "The stream is encrypted." isn't very nice. It's not a problem that it's encrypted - the problem is that there's it's encrypted and it can't be _decrypted_, so you should refer to that too. Also I think we can't bump the requirements of good/bad/ugly to cvs core right now, so we can't commit the plugin changes.
Created attachment 108930 [details] [review] add STREAM_DECRYPT and STREAM_DECRYPT_NOKEY error codes Alternative patch which tries to address two issues: - IMHO we should provide two different error codes for the case where decryption isn't supported by the element and where it is supported in principle, but the content can't be decrypted because on key has been supplied/found. - as Mike mentioned, the problem isn't really that the content is encrypted, but that it can't be decrypted, and both the enum and the error message should reflect that. I first went for something like GST_STREAM_ERROR_UNSUPPORTED_ENCRYPTION, but that's a bit long and I couldn't come up with an equivalent for the missing key situation, so I just went with GST_STREAM_ERROR_DECRYPT*. This is also more in line with the other error codes, ie. _DEMUX, _DECODE, _ENCODE.
Committed with Since: markers in the docs: 2008-04-09 Tim-Philipp Müller <tim at centricular dot net> Based on patch by: Milosz Derezynski <internalerror gmail com> * gst/gsterror.c: (_gst_stream_errors_init): * gst/gsterror.h: Add two new error codes for encrypted content. Fixes #524659. API: GST_STREAM_ERROR_DECRYPT API: GST_STREAM_ERROR_DECRYPT_NOKEY I'll make qtdemux/asfdemux use the new codes when we can depend on core CVS again (ie. after the upcoming plugins release).