am 0e8dc72d: Merge "Fix for issue 3453519: (Java/JNI) do not allow editing of DRM protected contents" into honeycomb-mr1

* commit '0e8dc72db34c0a4eb92763de4e048abc4d20f47f':
  Fix for issue 3453519: (Java/JNI) do not allow editing of DRM protected contents
This commit is contained in:
Santosh Madhava
2011-03-07 19:45:25 -08:00
committed by Android Git Automerger
4 changed files with 14 additions and 6 deletions

View File

@ -140,7 +140,7 @@ public class AudioTrack {
try {
properties = mMANativeHelper.getMediaProperties(filename);
} catch (Exception e) {
throw new IllegalArgumentException("Unsupported file or file not found");
throw new IllegalArgumentException(e.getMessage() + " : " + filename);
}
switch (mMANativeHelper.getFileType(properties.fileType)) {
case MediaProperties.FILE_3GP:

View File

@ -115,7 +115,7 @@ public class MediaVideoItem extends MediaItem {
try {
properties = mMANativeHelper.getMediaProperties(filename);
} catch ( Exception e) {
throw new IllegalArgumentException("Unsupported file or file not found: " + filename);
throw new IllegalArgumentException(e.getMessage() + " : " + filename);
}
switch (mMANativeHelper.getFileType(properties.fileType)) {

View File

@ -207,6 +207,7 @@ static const VideoEdit_Osal_Result gkRESULTS[] =
VIDEOEDIT_OSAL_RESULT_INIT(M4MCS_ERR_AUDIOBITRATE_TOO_HIGH ),
VIDEOEDIT_OSAL_RESULT_INIT(M4MCS_ERR_OUTPUT_FILE_SIZE_TOO_SMALL ),
VIDEOEDIT_OSAL_RESULT_INIT(M4MCS_ERR_NOMORE_SPACE ),
VIDEOEDIT_OSAL_RESULT_INIT(M4MCS_ERR_FILE_DRM_PROTECTED ),
// M4READER_Common.h
VIDEOEDIT_OSAL_RESULT_INIT(M4ERR_READER_UNKNOWN_STREAM_TYPE ),

View File

@ -204,10 +204,17 @@ jobject videoEditProp_getProperties(
result = getClipProperties(
pEnv, thiz, pFile, clipType, pClipProperties);
if (M4MCS_ERR_FILE_DRM_PROTECTED == result) {
// Check if the creation succeeded.
videoEditJava_checkAndThrowIllegalArgumentException(
&gotten, pEnv,(M4NO_ERROR != result),
"Invalid File or File not found");
"Invalid File - DRM Protected ");
} else {
// Check if the creation succeeded.
videoEditJava_checkAndThrowIllegalArgumentException(
&gotten, pEnv,(M4NO_ERROR != result),
"Invalid File or File not found ");
}
/**
* Max resolution supported is 1280 x 720.