Files
android/proprietary/wvm/WVMInfoListener.cpp
Jeffrey Tinker ba5fa0ef57 Fixes for b/4149416:expired license refresh, b/4126624:heartbeats, b/4171055: inconsistent license modes
Also includes b/3500025: A/V resync issues

Change-Id: Ib885d7219d211b188f38e9427bdaecd10fbd7329
2011-03-25 07:20:49 -07:00

61 lines
1.7 KiB
C++

/*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "WVMInfoListener"
#include <utils/Log.h>
#include "WVMExtractorImpl.h"
#include "WVMMediaSource.h"
#include "WVMFileSource.h"
#include "WVMInfoListener.h"
#include "WVMLogging.h"
#include "WVStreamControlAPI.h"
#include "media/stagefright/MediaErrors.h"
#include "media/stagefright/MediaDefs.h"
#include "drm/DrmInfoEvent.h"
namespace android {
void WVMInfoListener::setSession(WVSession *session)
{
mSession = session;
}
void WVMInfoListener::onInfo(const DrmInfoEvent &event)
{
//LOGD("WVMMediaSource::onInfo: type=%d, msg=%s!!!",
// event.getType(), event.getMessage().string());
if (event.getType() == MessageType_HeartbeatServer)
mServerUrl = event.getMessage();
else if (event.getType() == MessageType_HeartbeatPeriod)
mPeriod = atoi(event.getMessage());
}
void WVMInfoListener::configureHeartbeat()
{
// send the first time we have all the info
if (mSession && mServerUrl.size() && mPeriod != -1) {
//LOGD("WVMMediaSource::calling WV_ConfigureHeartbeat()");
WV_ConfigureHeartbeat(mSession, mServerUrl, mPeriod);
mSession = NULL;
}
}
};