Skip to: Site menu | Main content


Welcome to PSP-Programming.com, a place for developers to get together.

Welcome to the forums. Here you can find other user tutorials as well as homebrew releases and the source code repository. You can also ask for help with your code here and post your own homebrew!

PSP-Programming.com Forums
February 11, 2012, 01:15:12 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

News: Welcome to PSP-Programming.com
Home Help Search Shop Login Register
Digg This!
Pages: [1]
Print
Author Topic: Pmf Viewer  (Read 1360 times)
mowglisanu

C/C++ Developer
Hero Member
*

Karma: +36/-11
Offline Offline

Posts: 787
0.00 points

View Inventory
Send Money to mowglisanu


View Profile
« on: July 02, 2011, 08:06:17 PM »

The other day I wanted to watch some cut-scenes from a game(of course I didn't want to play the game), so I so i fired up google and searched for a pmf player. To my shock and horror I couldn't find any, so I decided to make one, and here it is.

Pmf Viewer allows you to browse the drives available on you psp(that I knew of) and view
pmf video files.

You can also browse images(iso and cso) and view the videos they contain.
This is based on the m33 sdk so may only work on m33 cfw.

Tested on 5.00 m33-6 phat

Controls
UP - Move up
DOWN - Move down
X/START - Select/Play
SQUARE - Pause
CIRCLE - Stop
TRIANGLE - Back
LTRIGGER - Slow down
RTRIGGER - Speed up
SELECT - Credits

If the is sufficient interest I might make a full 1.0 version

http://www.youtube.com/watch?v=j4hy0O777Gk



Download
Logged

Check out my:
 Audio lib
 Pmf Viewer


kenkai
If you're wasting time, you're wasting money and thats just sick.
Jr. Member
**

Karma: +0/-2
Offline Offline

Posts: 79
3331.06 points

View Inventory
Send Money to kenkai

View Profile
« Reply #1 on: July 12, 2011, 05:35:51 PM »

Could you upload your source code for this?
Logged
mowglisanu

C/C++ Developer
Hero Member
*

Karma: +36/-11
Offline Offline

Posts: 787
0.00 points

View Inventory
Send Money to mowglisanu


View Profile
« Reply #2 on: July 16, 2011, 10:42:10 AM »

Its just pmfplayer10 with some mods and a file browser.
What about it you want to know?
Logged

Check out my:
 Audio lib
 Pmf Viewer
kenkai
If you're wasting time, you're wasting money and thats just sick.
Jr. Member
**

Karma: +0/-2
Offline Offline

Posts: 79
3331.06 points

View Inventory
Send Money to kenkai

View Profile
« Reply #3 on: July 25, 2011, 09:50:19 PM »

How'd you do it without a prx file like pmfplayer10 used?
Logged
mowglisanu

C/C++ Developer
Hero Member
*

Karma: +36/-11
Offline Offline

Posts: 787
0.00 points

View Inventory
Send Money to mowglisanu


View Profile
« Reply #4 on: July 25, 2011, 09:54:51 PM »

It is opensource, it containd a class CPMFPlayer, which is basically all you need.
I have it in one of my shared folders, check one of my posts in source code repository section, I think the file name is pmfplayer10.zip
Logged

Check out my:
 Audio lib
 Pmf Viewer
kenkai
If you're wasting time, you're wasting money and thats just sick.
Jr. Member
**

Karma: +0/-2
Offline Offline

Posts: 79
3331.06 points

View Inventory
Send Money to kenkai

View Profile
« Reply #5 on: July 26, 2011, 10:03:39 AM »

ok. I was also having some other problems that we talked about awhile ago in this post

http://www.psp-programming.com/forums/index.php/topic,5052.0.html

did u manage to solve them in your pmf viewer?

Logged
mowglisanu

C/C++ Developer
Hero Member
*

Karma: +36/-11
Offline Offline

Posts: 787
0.00 points

View Inventory
Send Money to mowglisanu


View Profile
« Reply #6 on: July 26, 2011, 12:14:50 PM »

I didn't use relative paths,

To use relative path, your thread has to have a cwd.
libc sets the cwd for your main thread, but you'll have to set it for any thread you create.
Logged

Check out my:
 Audio lib
 Pmf Viewer
kenkai
If you're wasting time, you're wasting money and thats just sick.
Jr. Member
**

Karma: +0/-2
Offline Offline

Posts: 79
3331.06 points

View Inventory
Send Money to kenkai

View Profile
« Reply #7 on: July 26, 2011, 03:52:23 PM »

could you send me your code? I think it would help me understand better because i didn't understand very much of your last post lol
Logged
mowglisanu

C/C++ Developer
Hero Member
*

Karma: +36/-11
Offline Offline

Posts: 787
0.00 points

View Inventory
Send Money to mowglisanu


View Profile
« Reply #8 on: July 26, 2011, 08:01:35 PM »

Code: (pmfplayer/main.cpp)
/*
 * PMF Player Module
 * Copyright (c) 2006 by Sorin P. C. <magik@hypermagik.com>
 */
#include <pspkernel.h>

#include <stdio.h>
#include <malloc.h>
#include <string.h>

#include "pmfplayer.h"

PSP_MODULE_INFO(pmfPlayer, 0, 1, 1);

int main_thread(SceSize _argc, void* _argp)
{

CPMFPlayer *MpegDecoder = new CPMFPlayer();

if(MpegDecoder->Initialize() < 0)
{
pspDebugScreenInit();
pspDebugScreenPrintf(MpegDecoder->GetLastError());
sceKernelDelayThread(5000000);
return -1;
}

if(MpegDecoder->Load((char*)_argp) < 0)
{
pspDebugScreenInit();
pspDebugScreenPrintf(MpegDecoder->GetLastError());
sceKernelDelayThread(5000000);
return -1;
}

if(MpegDecoder->Play() < 0)
{
pspDebugScreenInit();
pspDebugScreenPrintf(MpegDecoder->GetLastError());
sceKernelDelayThread(5000000);
return -1;
}

MpegDecoder->Shutdown();

return 0;
}

extern "C" int module_start(SceSize _argc, char* _argp)
{
char* arg = _argp + strlen(_argp) + 1;

SceUID T = sceKernelCreateThread("pmfplayer_thread", main_thread, 0x20, 0xFA0, THREAD_ATTR_USER, NULL);

sceKernelStartThread(T, strlen(arg)+1, arg);

sceKernelWaitThreadEnd(T, 0);

return 0;
}
Notice the sceKernelCreateThread in module start
This thread T, has no Current working directory which is necessary for the use of relative paths such as ./video.pmf.
So either use full paths of set a current working directory for T
Logged

Check out my:
 Audio lib
 Pmf Viewer
kenkai
If you're wasting time, you're wasting money and thats just sick.
Jr. Member
**

Karma: +0/-2
Offline Offline

Posts: 79
3331.06 points

View Inventory
Send Money to kenkai

View Profile
« Reply #9 on: July 26, 2011, 09:30:23 PM »

ok, is there any way to change it so it could work with ./file.pmf?

and are you able to exit back to the xmb when a video is playing? I havent tested out your player yet so i dont know if you fixed all my problems
Logged
mowglisanu

C/C++ Developer
Hero Member
*

Karma: +36/-11
Offline Offline

Posts: 787
0.00 points

View Inventory
Send Money to mowglisanu


View Profile
« Reply #10 on: July 30, 2011, 02:42:13 PM »

ok, is there any way to change it so it could work with ./file.pmf?
1. Don't instanciate CPMFPlayer and call CPMFPlayer::Load  in a new thread
or
2. Set a current working directory for the thread.

Also I stop the player before exiting, CPMFPlayer creates multiple threads and semaphore, unexpected termination may result in indefinite waits.
Logged

Check out my:
 Audio lib
 Pmf Viewer
Pages: [1]
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 1.256 seconds with 35 queries.
Sister Sites: Guitar Hero 4   BrokeniTouch.com