After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 524659 - Add specific error code for encrypted streams (e.g. WMA/AAC DRM)
Add specific error code for encrypted streams (e.g. WMA/AAC DRM)
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal enhancement
: 0.10.20
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-03-27 15:31 UTC by Milosz Derezynski
Modified: 2008-04-09 17:49 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Patch for gst-core to add the stream-encrypted error (1.50 KB, patch)
2008-03-27 15:31 UTC, Milosz Derezynski
none Details | Review
Patch for -ugly to make asfdemux use the new error type (800 bytes, patch)
2008-03-27 15:32 UTC, Milosz Derezynski
none Details | Review
Patch for -good to make qtdemux use the new error type (621 bytes, patch)
2008-03-27 15:33 UTC, Milosz Derezynski
none Details | Review
Patch for -ugly to make asfdemux use the new error type (fixed) (773 bytes, patch)
2008-03-27 15:38 UTC, Milosz Derezynski
none Details | Review
add STREAM_DECRYPT and STREAM_DECRYPT_NOKEY error codes (1.90 KB, patch)
2008-04-09 14:49 UTC, Tim-Philipp Müller
committed Details | Review

Description Milosz Derezynski 2008-03-27 15:31:13 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).
Comment 1 Milosz Derezynski 2008-03-27 15:31:51 UTC
Created attachment 108113 [details] [review]
Patch for gst-core to add the stream-encrypted error
Comment 2 Milosz Derezynski 2008-03-27 15:32:24 UTC
Created attachment 108114 [details] [review]
Patch for -ugly to make asfdemux use the new error type
Comment 3 Milosz Derezynski 2008-03-27 15:33:40 UTC
Created attachment 108115 [details] [review]
Patch for -good to make qtdemux use the new error type
Comment 4 Milosz Derezynski 2008-03-27 15:38:32 UTC
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.
Comment 5 Michael Smith 2008-03-27 18:13:32 UTC
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.

Comment 6 Tim-Philipp Müller 2008-04-09 14:49:52 UTC
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.
Comment 7 Tim-Philipp Müller 2008-04-09 17:49:04 UTC
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).