#ifndef __USE_VideoView2_C_H__
#define __USE_VideoView2_C_H__

#include "videoview.h"
#include <QtWidgets/QWidget>
#include <QDebug>

class CVideoView2 : public QWidget,public IVideoView
   // : public CVideoViewHost
{
public:
	Q_OBJECT
public:
    CVideoView2(QWidget* parent,int id);
	virtual ~CVideoView2();
public:
    rtc::IVideoRender* getRender(){  return m_videoRenderer; }
    bool setScalingType(rtc::IVideoRenderView::ScalingType type);
    rtc::IVideoRender* GetRender();
    void updateViewSize(int width, int height);
protected:
    //void onCreateWnd(HWND hwnd);
    void resizeEvent(QResizeEvent* event);
    void paintEvent(QPaintEvent *event);
protected:
    rtc::IVideoRenderView* m_videoRendererView;
    rtc::IVideoRender*	 m_videoRenderer;
    int m_id;
#if 0
	AVDHandle getRender() { return m_videoRenderer; }
	bool setScalingType(AVDScalingType type);
	void updateViewSize(int width, int height);
public:
	void paintEvent(QPaintEvent *event);
	void resizeEvent(QResizeEvent* event);
protected:
	AVDHandle m_videoRenderer;
	void* m_window;
#endif
};

#endif //__USE_VideoView2_C_H__
