Ejemplo n.º 1
0
void CplayerDlg::OnVideoMode()
{
    int mode = 0;
    player_getparam(g_hplayer, PARAM_VIDEO_MODE, &mode);
    mode = (mode == VIDEO_MODE_LETTERBOX) ? VIDEO_MODE_STRETCHED : VIDEO_MODE_LETTERBOX;
    player_setparam(g_hplayer, PARAM_VIDEO_MODE, &mode);
}
Ejemplo n.º 2
0
/*
 * Class:     com_rockcarry_ffplayer_MediaPlayer
 * Method:    nativeSetDisplaySurface
 * Signature: (JLjava/lang/Object;)V
 */
static void JNICALL nativeSetDisplaySurface(JNIEnv *env, jobject obj, jlong hplayer, jobject surface)
{
    DO_USE_VAR(obj);
    void *vdev = NULL;
    player_getparam((void*)hplayer, PARAM_VDEV_GET_CONTEXT, &vdev);
    vdev_android_setwindow(vdev, surface);
}
Ejemplo n.º 3
0
void CplayerDlg::OnEffectMode()
{
    int mode = 0;
    player_getparam(g_hplayer, PARAM_VISUAL_EFFECT, &mode);
    mode++; mode %= VISUAL_EFFECT_MAX_NUM;
    player_setparam(g_hplayer, PARAM_VISUAL_EFFECT, &mode);
}
Ejemplo n.º 4
0
void CplayerDlg::OnVideoMode()
{
    int mode = 0;
    player_getparam(g_hplayer, PARAM_VIDEO_MODE, &mode);
    mode++; mode %= VIDEO_MODE_MAX_NUM;
    player_setparam(g_hplayer, PARAM_VIDEO_MODE, &mode);
}
Ejemplo n.º 5
0
/*
 * Class:     com_rockcarry_ffplayer_MediaPlayer
 * Method:    nativeGetParam
 * Signature: (JI)J
 */
static jlong JNICALL nativeGetParam(JNIEnv *env, jobject obj, jlong hplayer, jint id)
{
    DO_USE_VAR(env);
    DO_USE_VAR(obj);
    jlong value = 0;
    player_getparam((void*)hplayer, id, &value);
    return value;
}
Ejemplo n.º 6
0
void CplayerDlg::OnPaint()
{
    if (IsIconic())
    {
        CPaintDC dc(this); // device context for painting

        SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);

        // Center icon in client rectangle
        int cxIcon = GetSystemMetrics(SM_CXICON);
        int cyIcon = GetSystemMetrics(SM_CYICON);
        CRect rect;
        GetClientRect(&rect);
        int x = (rect.Width () - cxIcon + 1) / 2;
        int y = (rect.Height() - cyIcon + 1) / 2;

        // Draw the icon
        dc.DrawIcon(x, y, m_hIcon);
    }
    else
    {
        CPaintDC dc(this);

        LONGLONG total = 1, pos = 0;
        player_getparam(g_hplayer, PARAM_MEDIA_DURATION, &total);
        player_getparam(g_hplayer, PARAM_MEDIA_POSITION, &pos  );
        if (pos > 0) {
            RECT fill  = m_rtClient;
            fill.right = (LONG)(fill.right * pos / total);
            fill.top   = fill.bottom - 2;
            dc.FillSolidRect(&fill, RGB(250, 150, 0));
            fill.left  = fill.right;
            fill.right = m_rtClient.right;
            dc.FillSolidRect(&fill, RGB(0, 0, 0));
        }

        CDialog::OnPaint();
    }
}
Ejemplo n.º 7
0
void CplayerDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
    if (point.y > m_rtClient.bottom - 8)
    {
        LONGLONG total = 1;
        player_getparam(g_hplayer, PARAM_MEDIA_DURATION, &total);
        player_seek(g_hplayer, total * point.x / m_rtClient.right);
    }
    else {
        if (!m_bPlayPause) player_pause(g_hplayer);
        else player_play(g_hplayer);
        m_bPlayPause = !m_bPlayPause;
    }

    CDialog::OnLButtonDown(nFlags, point);
}