Merge "Implement new heartbeat error codes" into honeycomb-mr1
This commit is contained in:
committed by
Android (Google) Code Review
commit
88aa52ffdf
@@ -20,6 +20,7 @@
|
||||
#include "WVMMediaSource.h"
|
||||
#include "WVMFileSource.h"
|
||||
#include "WVMExtractorImpl.h"
|
||||
#include "WVMErrorCodes.h"
|
||||
#include "media/stagefright/MediaErrors.h"
|
||||
#include "media/stagefright/MediaDefs.h"
|
||||
#include "media/stagefright/MediaDebug.h"
|
||||
@@ -207,23 +208,46 @@ status_t WVMMediaSource::read(MediaBuffer **buffer, const ReadOptions *options)
|
||||
|
||||
WVStatus result = WV_GetEsData(mSession, mESSelector, (uint8_t *)mediaBuf->data() + offset,
|
||||
size, bytesRead, auStart, mDts, mPts, syncFrame);
|
||||
if (result == WV_Status_End_Of_Media) {
|
||||
mediaBuf->release();
|
||||
return ERROR_END_OF_STREAM;
|
||||
} else if (result == WV_Status_Terminate_Requested) {
|
||||
mediaBuf->release();
|
||||
return ERROR_NO_LICENSE;
|
||||
} else if (result != WV_Status_OK) {
|
||||
if (result != WV_Status_Warning_Need_Key &&
|
||||
result != WV_Status_Warning_Download_Stalled)
|
||||
{
|
||||
|
||||
if (result != WV_Status_OK &&
|
||||
result != WV_Status_Warning_Need_Key &&
|
||||
result != WV_Status_Warning_Download_Stalled) {
|
||||
|
||||
status_t status;
|
||||
|
||||
switch(result) {
|
||||
case WV_Status_End_Of_Media:
|
||||
status = ERROR_END_OF_STREAM;
|
||||
break;
|
||||
case WV_Status_Terminate_Requested:
|
||||
status = ERROR_HEARTBEAT_TERMINATE_REQUESTED;
|
||||
break;
|
||||
case YT_HEARTBEAT_NO_ACTIVE_PURCHASE_AGREEMENT:
|
||||
status = ERROR_HEARTBEAT_NO_ACTIVE_PURCHASE_AGREEMENT;
|
||||
break;
|
||||
case YT_HEARTBEAT_CONCURRENT_PLAYBACK:
|
||||
status = ERROR_HEARTBEAT_CONCURRENT_PLAYBACK;
|
||||
break;
|
||||
case YT_HEARTBEAT_UNUSUAL_ACTIVITY:
|
||||
status = ERROR_HEARTBEAT_UNUSUAL_ACTIVITY;
|
||||
break;
|
||||
case YT_HEARTBEAT_STREAMING_UNAVAILABLE:
|
||||
status = ERROR_HEARTBEAT_STREAMING_UNAVAILABLE;
|
||||
break;
|
||||
case YT_HEARTBEAT_CANNOT_ACTIVATE_RENTAL:
|
||||
status = ERROR_HEARTBEAT_CANNOT_ACTIVATE_RENTAL;
|
||||
break;
|
||||
default:
|
||||
if (mLogOnce) {
|
||||
LOGE("WV_GetEsData returned ERROR %d in WVMMediaSource::read\n", result);
|
||||
mLogOnce = false;
|
||||
}
|
||||
mediaBuf->release();
|
||||
return ERROR_IO;
|
||||
status = ERROR_IO;
|
||||
break;
|
||||
}
|
||||
|
||||
mediaBuf->release();
|
||||
return status;
|
||||
}
|
||||
|
||||
if (sLastError != NO_ERROR) {
|
||||
|
||||
9
proprietary/wvm/include/WVMErrorCodes.h
Normal file
9
proprietary/wvm/include/WVMErrorCodes.h
Normal file
@@ -0,0 +1,9 @@
|
||||
enum {
|
||||
// YouTube Heartbeat error codes
|
||||
YT_HEARTBEAT_CANNOT_AUTHENTICATE = 513,
|
||||
YT_HEARTBEAT_NO_ACTIVE_PURCHASE_AGREEMENT = 514,
|
||||
YT_HEARTBEAT_CONCURRENT_PLAYBACK = 515,
|
||||
YT_HEARTBEAT_UNUSUAL_ACTIVITY = 516,
|
||||
YT_HEARTBEAT_STREAMING_UNAVAILABLE = 517,
|
||||
YT_HEARTBEAT_CANNOT_ACTIVATE_RENTAL = 518,
|
||||
};
|
||||
Reference in New Issue
Block a user