Ejemplo n.º 1
0
class ImageConverterIPP : public ImageConverter //Q_AV_EXPORT is not needed
{
    DPTR_DECLARE_PRIVATE(ImageConverterIPP)
public:
    ImageConverterIPP();
    virtual bool convert(const quint8 *const srcSlice[], const int srcStride[]);
protected:
    virtual bool prepareData(); //Allocate memory for out data
};

ImageConverterId ImageConverterId_IPP = 2;
FACTORY_REGISTER_ID_AUTO(ImageConverter, IPP, "IPP")

void RegisterImageConverterIPP_Man()
{
    FACTORY_REGISTER_ID_MAN(ImageConverter, IPP, "IPP")
}

class ImageConverterIPPPrivate : public ImageConverterPrivate
{
public:
    ImageConverterIPPPrivate():need_scale(true) {}
    bool need_scale;
    QByteArray orig_ori_rgb;
};

ImageConverterIPP::ImageConverterIPP()
    :ImageConverter(*new ImageConverterIPPPrivate())
{
}
Ejemplo n.º 2
0
public:
    AudioOutputPortAudio();
    ~AudioOutputPortAudio();
    bool open();
    bool close();
    virtual void waitForNextBuffer();
protected:
    bool write();
};

extern AudioOutputId AudioOutputId_PortAudio;
FACTORY_REGISTER_ID_AUTO(AudioOutput, PortAudio, "PortAudio")

void RegisterAudioOutputPortAudio_Man()
{
    FACTORY_REGISTER_ID_MAN(AudioOutput, PortAudio, "PortAudio")
}

class AudioOutputPortAudioPrivate : public AudioOutputPrivate
{
public:
    AudioOutputPortAudioPrivate():
        initialized(false)
      ,outputParameters(new PaStreamParameters)
      ,stream(0)
    {
        PaError err = paNoError;
        if ((err = Pa_Initialize()) != paNoError) {
            qWarning("Error when init portaudio: %s", Pa_GetErrorText(err));
            available = false;
            return;
Ejemplo n.º 3
0
    DPTR_DECLARE_PRIVATE(ImageConverterFF)
public:
    ImageConverterFF();
    virtual bool check() const;
    virtual bool convert(const quint8 *const srcSlice[], const int srcStride[]);
protected:
    virtual bool setupColorspaceDetails();
};


ImageConverterId ImageConverterId_FF = 1;
FACTORY_REGISTER_ID_AUTO(ImageConverter, FF, "FFmpeg")

void RegisterImageConverterFF_Man()
{
    FACTORY_REGISTER_ID_MAN(ImageConverter, FF, "FFmpeg")
}

class ImageConverterFFPrivate : public ImageConverterPrivate
{
public:
    ImageConverterFFPrivate()
        : sws_ctx(0)
        , update_eq(true)
    {}
    ~ImageConverterFFPrivate() {
        if (sws_ctx) {
            sws_freeContext(sws_ctx);
            sws_ctx = 0;
        }
    }
Ejemplo n.º 4
0
    virtual bool open();
    virtual bool close();
    virtual BufferControl supportedBufferControl() const;
    virtual bool play();
protected:
    virtual bool write(const QByteArray& data);
    //default return -1. means not the control
    virtual int getPlayedCount();
};

extern AudioOutputId AudioOutputId_OpenSL;
FACTORY_REGISTER_ID_AUTO(AudioOutput, OpenSL, "OpenSL")

void RegisterAudioOutputOpenSL_Man()
{
    FACTORY_REGISTER_ID_MAN(AudioOutput, OpenSL, "OpenSL")
}

#define SL_RUN_CHECK_RETURN(FUNC, RET) \
    do { \
        SLresult ret = FUNC; \
        if (ret != SL_RESULT_SUCCESS) { \
            qWarning("AudioOutputOpenSL Error>>> " #FUNC " (%lu)", ret); \
            return RET; \
        } \
    } while(0)
#define SL_RUN_CHECK(FUNC) SL_RUN_CHECK_RETURN(FUNC,)
#define SL_RUN_CHECK_FALSE(FUNC) SL_RUN_CHECK_RETURN(FUNC, false)

static SLDataFormat_PCM audioFormatToSL(const AudioFormat &format)
{
Ejemplo n.º 5
0
    //draw the current frame using the current paint engine. called by paintEvent()
    virtual void drawFrame();
    /*usually you don't need to reimplement paintEvent, just drawXXX() is ok. unless you want do all
     *things yourself totally*/
    virtual void paintEvent(QPaintEvent *);
    virtual void resizeEvent(QResizeEvent *);
    //stay on top will change parent, hide then show(windows). we need GetDC() again
    virtual void showEvent(QShowEvent *);
};
typedef Direct2DRenderer VideoRendererDirect2D;
extern VideoRendererId VideoRendererId_Direct2D;
FACTORY_REGISTER_ID_AUTO(VideoRenderer, Direct2D, "Direct2D")

void RegisterVideoRendererDirect2D_Man()
{
    FACTORY_REGISTER_ID_MAN(VideoRenderer, Direct2D, "Direct2D")
}

VideoRendererId Direct2DRenderer::id() const
{
    return VideoRendererId_Direct2D;
}
class Direct2DRendererPrivate : public VideoRendererPrivate
{
public:
    DPTR_DECLARE_PUBLIC(Direct2DRenderer)

    Direct2DRendererPrivate():
        d2d_factory(0)
      , render_target(0)
      , bitmap(0)
Ejemplo n.º 6
0
    virtual bool open();
    virtual bool close();
    virtual bool isSupported(AudioFormat::SampleFormat sampleFormat) const;
    virtual BufferControl supportedBufferControl() const;
    virtual bool play();
protected:
    virtual bool write(const QByteArray& data);
    virtual int getOffsetByBytes();
};

extern AudioOutputId AudioOutputId_DSound;
FACTORY_REGISTER_ID_AUTO(AudioOutput, DSound, "DirectSound")

void RegisterAudioOutputDSound_Man()
{
    FACTORY_REGISTER_ID_MAN(AudioOutput, DSound, "DirectSound")
}


template <class T> void SafeRelease(T **ppT) {
  if (*ppT) {
    (*ppT)->Release();
    *ppT = NULL;
  }
}

// use the definitions from the win32 api headers when they define these
#define WAVE_FORMAT_IEEE_FLOAT      0x0003
#define WAVE_FORMAT_DOLBY_AC3_SPDIF 0x0092
#define WAVE_FORMAT_EXTENSIBLE      0xFFFE
/* GUID SubFormat IDs */