|
Packit |
1244b8 |
/*
|
|
Packit |
1244b8 |
* Copyright (C) 2014 Intel Corporation. All rights reserved.
|
|
Packit |
1244b8 |
*
|
|
Packit |
1244b8 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
Packit |
1244b8 |
* you may not use this file except in compliance with the License.
|
|
Packit |
1244b8 |
* You may obtain a copy of the License at
|
|
Packit |
1244b8 |
*
|
|
Packit |
1244b8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
Packit |
1244b8 |
*
|
|
Packit |
1244b8 |
* Unless required by applicable law or agreed to in writing, software
|
|
Packit |
1244b8 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
Packit |
1244b8 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
Packit |
1244b8 |
* See the License for the specific language governing permissions and
|
|
Packit |
1244b8 |
* limitations under the License.
|
|
Packit |
1244b8 |
*/
|
|
Packit |
1244b8 |
|
|
Packit |
1244b8 |
#ifndef vaapicontext_h
|
|
Packit |
1244b8 |
#define vaapicontext_h
|
|
Packit |
1244b8 |
|
|
Packit |
1244b8 |
#include "common/NonCopyable.h"
|
|
Packit |
1244b8 |
#include "VideoCommonDefs.h"
|
|
Packit |
1244b8 |
#include "vaapi/vaapiptrs.h"
|
|
Packit |
1244b8 |
#include <va/va.h>
|
|
Packit |
1244b8 |
|
|
Packit |
1244b8 |
namespace YamiMediaCodec{
|
|
Packit |
1244b8 |
class VaapiConfig
|
|
Packit |
1244b8 |
{
|
|
Packit |
1244b8 |
friend class VaapiContext;
|
|
Packit |
1244b8 |
public:
|
|
Packit |
1244b8 |
static YamiStatus create(const DisplayPtr&, VAProfile, VAEntrypoint,
|
|
Packit |
1244b8 |
VAConfigAttrib* attribList, int numAttribs, ConfigPtr& confg);
|
|
Packit |
1244b8 |
~VaapiConfig();
|
|
Packit |
1244b8 |
private:
|
|
Packit |
1244b8 |
VaapiConfig(const DisplayPtr&, VAConfigID);
|
|
Packit |
1244b8 |
DisplayPtr m_display;
|
|
Packit |
1244b8 |
VAConfigID m_config;
|
|
Packit |
1244b8 |
DISALLOW_COPY_AND_ASSIGN(VaapiConfig);
|
|
Packit |
1244b8 |
};
|
|
Packit |
1244b8 |
|
|
Packit |
1244b8 |
class VaapiContext
|
|
Packit |
1244b8 |
{
|
|
Packit |
1244b8 |
public:
|
|
Packit |
1244b8 |
static ContextPtr create(const ConfigPtr&,
|
|
Packit |
1244b8 |
int width,int height,int flag,
|
|
Packit |
1244b8 |
VASurfaceID *render_targets,
|
|
Packit |
1244b8 |
int num_render_targets);
|
|
Packit |
1244b8 |
VAContextID getID() const { return m_context; }
|
|
Packit |
1244b8 |
DisplayPtr getDisplay() const { return m_config->m_display; }
|
|
Packit |
1244b8 |
|
|
Packit |
1244b8 |
~VaapiContext();
|
|
Packit |
1244b8 |
private:
|
|
Packit |
1244b8 |
VaapiContext(const ConfigPtr&, VAContextID);
|
|
Packit |
1244b8 |
ConfigPtr m_config;
|
|
Packit |
1244b8 |
VAContextID m_context;
|
|
Packit |
1244b8 |
DISALLOW_COPY_AND_ASSIGN(VaapiContext);
|
|
Packit |
1244b8 |
};
|
|
Packit |
1244b8 |
}
|
|
Packit |
1244b8 |
#endif
|