 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
Raphael

Joined: 17 Jan 2006 Posts: 646 Location: Germany
|
Posted: Fri Jul 20, 2007 11:57 am Post subject: [patch] cooleyes' pspaudio plus some pspmpeg findings |
|
|
I just added cooleyes pspaudio findings (sceAudioSetFrequency) and his updated stub file to my local SDK.
Along with that, I also found a way to set the pspmpeg's decode pixelformat, so it is now possible to decode video in any of the four possible display pixelformats (4444, 5650, 5551 and 8888). I'm not sure about the other value in SceMpegAvcMode though as it doesn't have any visible influence on the output.
Another change is my faulty doxygen comment on pspdisplays SetFrameBuf - the call obviously functions with other modes than 8888 too, at least with SET_NEXTFRAME.
I also took the chance and added my name to the headers in question, if no one's got a problem with that :P
Patch to be applied from pspsdk/
| Code: |
Index: src/audio/pspaudio.h
===================================================================
--- src/audio/pspaudio.h (revision 2270)
+++ src/audio/pspaudio.h (working copy)
@@ -7,6 +7,8 @@
*
* Copyright (c) 2005 Adresd
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
+ * Copyright (c) 2007 cooleyes
+ * Copyright (c) 2007 Alexander Berl <raphael@fx-world.org>
*
* $Id$
*/
@@ -38,6 +40,13 @@
PSP_AUDIO_FORMAT_MONO = 0x10
};
+enum PspAudioFrequencies {
+ /** Sampling frequency set to 44100Hz. */
+ PSP_AUDIO_FREQ_44K = 44100,
+ /** Sampling frequency set to 48000Hz. */
+ PSP_AUDIO_FREQ_48K = 48000
+};
+
/** The minimum number of samples that can be allocated to a channel. */
#define PSP_AUDIO_SAMPLE_MIN 64
/** The maximum number of samples that can be allocated to a channel. */
@@ -114,6 +123,14 @@
*/
int sceAudioChangeChannelVolume(int channel, int leftvol, int rightvol);
+/**
+ * Set audio sampling frequency
+ *
+ * @param frequency - Sampling frequency to set audio output to - either 44100 or 48000.
+ *
+ * @returns 0 on success, an error if less than 0.
+ */
+int sceAudioSetFrequency(int frequency);
/*@}*/
#ifdef __cplusplus
Index: src/audio/sceAudio.S
===================================================================
--- src/audio/sceAudio.S (revision 2270)
+++ src/audio/sceAudio.S (working copy)
@@ -3,62 +3,114 @@
#include "pspimport.s"
#ifdef F_sceAudio_0000
- IMPORT_START "sceAudio",0x40010000
+ IMPORT_START "sceAudio",0x00010000
#endif
+
#ifdef F_sceAudio_0001
- IMPORT_FUNC "sceAudio",0x8C1009B2,sceAudioOutput
+ IMPORT_FUNC "sceAudio",0x80F1F7E0,sceAudioInit
#endif
-#ifdef F_sceAudio_0002
- IMPORT_FUNC "sceAudio",0x136CAF51,sceAudioOutputBlocking
+
+#ifdef F_sceAudio_0002
+ IMPORT_FUNC "sceAudio",0x210567F7,sceAudioEnd
#endif
-#ifdef F_sceAudio_0003
- IMPORT_FUNC "sceAudio",0xE2D56B2D,sceAudioOutputPanned
+
+#ifdef F_sceAudio_0003
+ IMPORT_FUNC "sceAudio",0xA2BEAA6C,sceAudioSetFrequency
#endif
+
#ifdef F_sceAudio_0004
- IMPORT_FUNC "sceAudio",0x13F592BC,sceAudioOutputPannedBlocking
+ IMPORT_FUNC "sceAudio",0xB61595C0,sceAudioLoopbackTest
#endif
+
#ifdef F_sceAudio_0005
- IMPORT_FUNC "sceAudio",0x5EC81C55,sceAudioChReserve
+ IMPORT_FUNC "sceAudio",0x927AC32B,sceAudioSetVolumeOffset
#endif
+
#ifdef F_sceAudio_0006
- IMPORT_FUNC "sceAudio",0x41EFADE7,sceAudioOneshotOutput
+ IMPORT_FUNC "sceAudio",0x8C1009B2,sceAudioOutput
#endif
+
#ifdef F_sceAudio_0007
- IMPORT_FUNC "sceAudio",0x6FC46853,sceAudioChRelease
+ IMPORT_FUNC "sceAudio",0x136CAF51,sceAudioOutputBlocking
#endif
+
#ifdef F_sceAudio_0008
- IMPORT_FUNC "sceAudio",0xE9D97901,sceAudioGetChannelRestLen
+ IMPORT_FUNC "sceAudio",0xE2D56B2D,sceAudioOutputPanned
#endif
+
#ifdef F_sceAudio_0009
- IMPORT_FUNC "sceAudio",0xCB2E439E,sceAudioSetChannelDataLen
+ IMPORT_FUNC "sceAudio",0x13F592BC,sceAudioOutputPannedBlocking
#endif
+
#ifdef F_sceAudio_0010
- IMPORT_FUNC "sceAudio",0x95FD0C2D,sceAudioChangeChannelConfig
+ IMPORT_FUNC "sceAudio",0x5EC81C55,sceAudioChReserve
#endif
+
#ifdef F_sceAudio_0011
- IMPORT_FUNC "sceAudio",0xB7E1D8E7,sceAudioChangeChannelVolume
+ IMPORT_FUNC "sceAudio",0x41EFADE7,sceAudioOneshotOutput
#endif
+
#ifdef F_sceAudio_0012
- IMPORT_FUNC "sceAudio",0x38553111,sceAudio_38553111
+ IMPORT_FUNC "sceAudio",0x6FC46853,sceAudioChRelease
#endif
+
#ifdef F_sceAudio_0013
- IMPORT_FUNC "sceAudio",0x5C37C0AE,sceAudio_5C37C0AE
+ IMPORT_FUNC "sceAudio",0xB011922F,sceAudio_B011922F
#endif
+
#ifdef F_sceAudio_0014
- IMPORT_FUNC "sceAudio",0xE0727056,sceAudio_E0727056
+ IMPORT_FUNC "sceAudio",0xCB2E439E,sceAudioSetChannelDataLen
#endif
+
#ifdef F_sceAudio_0015
- IMPORT_FUNC "sceAudio",0x086E5895,sceAudioInputBlocking
+ IMPORT_FUNC "sceAudio",0x95FD0C2D,sceAudioChangeChannelConfig
#endif
+
#ifdef F_sceAudio_0016
- IMPORT_FUNC "sceAudio",0x6D4BEC68,sceAudioInput
+ IMPORT_FUNC "sceAudio",0xB7E1D8E7,sceAudioChangeChannelVolume
#endif
+
#ifdef F_sceAudio_0017
- IMPORT_FUNC "sceAudio",0xA708C6A6,sceAudioGetInputLength
+ IMPORT_FUNC "sceAudio",0x38553111,sceAudio_38553111
#endif
+
#ifdef F_sceAudio_0018
- IMPORT_FUNC "sceAudio",0x87B2E651,sceAudioWaitInputEnd
+ IMPORT_FUNC "sceAudio",0x5C37C0AE,sceAudio_5C37C0AE
#endif
+
#ifdef F_sceAudio_0019
- IMPORT_FUNC "sceAudio",0x7DE61688,sceAudioInputInit
+ IMPORT_FUNC "sceAudio",0xE0727056,sceAudio_E0727056
#endif
+
+#ifdef F_sceAudio_0020
+ IMPORT_FUNC "sceAudio",0x086E5895,sceAudioInputBlocking
+#endif
+
+#ifdef F_sceAudio_0021
+ IMPORT_FUNC "sceAudio",0x6D4BEC68,sceAudioInput
+#endif
+
+#ifdef F_sceAudio_0022
+ IMPORT_FUNC "sceAudio",0xA708C6A6,sceAudioGetInputLength
+#endif
+
+#ifdef F_sceAudio_0023
+ IMPORT_FUNC "sceAudio",0x87B2E651,sceAudioWaitInputEnd
+#endif
+
+#ifdef F_sceAudio_0024
+ IMPORT_FUNC "sceAudio",0x7DE61688,sceAudioInputInit
+#endif
+
+#ifdef F_sceAudio_0025
+ IMPORT_FUNC "sceAudio",0xE926D3FB,sceAudioInputInitEx
+#endif
+
+#ifdef F_sceAudio_0026
+ IMPORT_FUNC "sceAudio",0xA633048E,sceAudioPollInputEnd
+#endif
+
+#ifdef F_sceAudio_0027
+ IMPORT_FUNC "sceAudio",0xE9D97901,sceAudioGetChannelRestLen
+#endif
+
Index: src/mpeg/pspmpeg.h
===================================================================
--- src/mpeg/pspmpeg.h (revision 2270)
+++ src/mpeg/pspmpeg.h (working copy)
@@ -6,6 +6,7 @@
* pspmpeg.h - Prototypes for the sceMpeg library
*
* Copyright (c) 2006 Sorin P. C. <magik@hypermagik.com>
+ * Copyright (c) 2007 Alexander Berl <raphael@fx-world.org>
*
* $Id$
*/
@@ -61,30 +62,38 @@
typedef struct SceMpegAu
{
- /** unknown */
- SceUInt32 iUnk0;
- /** presentation timestamp? */
- SceInt32 iTimestamp;
- /** unknown */
- SceUInt32 iUnk1;
- /** unknown */
- SceUInt32 iUnk2;
- /** unknown */
- SceUInt32 iUnk3;
- /** unknown */
- SceUInt32 iUnk4;
+ /** presentation timestamp MSB */
+ SceUInt32 iPtsMSB;
+ /** presentation timestamp LSB */
+ SceUInt32 iPts;
+ /** decode timestamp MSB */
+ SceUInt32 iDtsMSB;
+ /** decode timestamp LSB */
+ SceUInt32 iDts;
+ /** Es buffer handle */
+ SceUInt32 iEsBuffer;
+ /** Au size */
+ SceUInt32 iAuSize;
} SceMpegAu;
+
+#define SCE_MPEG_AVC_FORMAT_DEFAULT -1
+#define SCE_MPEG_AVC_FORMAT_5650 0
+#define SCE_MPEG_AVC_FORMAT_5551 1
+#define SCE_MPEG_AVC_FORMAT_4444 2
+#define SCE_MPEG_AVC_FORMAT_8888 3
+
typedef struct SceMpegAvcMode
{
/** unknown, set to -1 */
SceInt32 iUnk0;
- /** unknonw, set to 3 */
- SceInt32 iUnk1;
+ /** Decode pixelformat */
+ SceInt32 iPixelFormat;
} SceMpegAvcMode;
+
/**
* sceMpegInit
*
@@ -275,6 +284,8 @@
/**
* sceMpegAvcDecodeMode
*
+ * @param Mpeg - SceMpeg handle
+ * @param pMode - pointer to SceMpegAvcMode struct defining the decode mode (pixelformat)
* @returns 0 if success.
*/
SceInt32 sceMpegAvcDecodeMode(SceMpeg* Mpeg, SceMpegAvcMode* pMode);
Index: src/display/pspdisplay.h
===================================================================
--- src/display/pspdisplay.h (revision 2270)
+++ src/display/pspdisplay.h (working copy)
@@ -8,6 +8,7 @@
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
* Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
+ * Copyright (c) 2007 Alexander Berl <raphael@fx-world.org>
*
* $Id$
*/
@@ -77,7 +78,7 @@
*
* @param topaddr - address of start of framebuffer
* @param bufferwidth - buffer width (must be power of 2)
- * @param pixelformat - One of ::PspDisplayPixelFormats. (only succeeds with PSP_DISPLAY_PIXEL_FORMAT_8888)
+ * @param pixelformat - One of ::PspDisplayPixelFormats.
* @param sync - One of ::PspDisplaySetBufSync
*
* @return 0 on success
Index: src/display/pspdisplay_kernel.h
===================================================================
--- src/display/pspdisplay_kernel.h (revision 2270)
+++ src/display/pspdisplay_kernel.h (working copy)
@@ -8,6 +8,7 @@
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
* Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
+ * Copyright (c) 2007 Alexander Berl <raphael@fx-world.org>
*
* $Id$
*/
|
_________________ <Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Fri Jul 20, 2007 10:06 pm Post subject: |
|
|
| Code: | /tmp/pspsdk$ svn update
At revision 2270.
/tmp/pspsdk$ cat /tmp/patch.txt | patch -p0 --dry-run
patching file src/audio/pspaudio.h
Hunk #1 succeeded at 7 with fuzz 2.
patching file src/audio/sceAudio.S
patching file src/mpeg/pspmpeg.h
Hunk #1 FAILED at 6.
Hunk #2 FAILED at 62.
Hunk #3 FAILED at 284.
3 out of 3 hunks FAILED -- saving rejects to file src/mpeg/pspmpeg.h.rej
patching file src/display/pspdisplay.h
Hunk #1 succeeded at 8 with fuzz 2.
patching file src/display/pspdisplay_kernel.h
Hunk #1 succeeded at 8 with fuzz 2. |
This is what I get when I attempt to apply the patch. I'm a little hesitant to manually resolve the rejects - which revision of pspsdk did you use? |
|
| Back to top |
|
 |
Raphael

Joined: 17 Jan 2006 Posts: 646 Location: Germany
|
Posted: Fri Jul 20, 2007 10:54 pm Post subject: |
|
|
Strange, I just redownloaded the rev 2270 and patched the files manually a couple of times and created a new patch file. Still gives the same error every time, no matter what I try.
Well, here's the patch for pspaudio/pspdisplay:
| Code: |
Index: src/audio/pspaudio.h
===================================================================
--- src/audio/pspaudio.h (revision 2270)
+++ src/audio/pspaudio.h (working copy)
@@ -7,6 +7,8 @@
*
* Copyright (c) 2005 Adresd
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
+ * Copyright (c) 2007 cooleyes
+ * Copyright (c) 2007 Alexander Berl <raphael@fx-world.org>
*
* $Id$
*/
@@ -38,6 +40,13 @@
PSP_AUDIO_FORMAT_MONO = 0x10
};
+enum PspAudioFrequencies {
+ /** Sampling frequency set to 44100Hz. */
+ PSP_AUDIO_FREQ_44K = 44100,
+ /** Sampling frequency set to 48000Hz. */
+ PSP_AUDIO_FREQ_48K = 48000
+};
+
/** The minimum number of samples that can be allocated to a channel. */
#define PSP_AUDIO_SAMPLE_MIN 64
/** The maximum number of samples that can be allocated to a channel. */
@@ -114,6 +123,14 @@
*/
int sceAudioChangeChannelVolume(int channel, int leftvol, int rightvol);
+/**
+ * Set audio sampling frequency
+ *
+ * @param frequency - Sampling frequency to set audio output to - either 44100 or 48000.
+ *
+ * @returns 0 on success, an error if less than 0.
+ */
+int sceAudioSetFrequency(int frequency);
/*@}*/
#ifdef __cplusplus
Index: src/audio/sceAudio.S
===================================================================
--- src/audio/sceAudio.S (revision 2270)
+++ src/audio/sceAudio.S (working copy)
@@ -3,62 +3,114 @@
#include "pspimport.s"
#ifdef F_sceAudio_0000
- IMPORT_START "sceAudio",0x40010000
+ IMPORT_START "sceAudio",0x00010000
#endif
+
#ifdef F_sceAudio_0001
- IMPORT_FUNC "sceAudio",0x8C1009B2,sceAudioOutput
+ IMPORT_FUNC "sceAudio",0x80F1F7E0,sceAudioInit
#endif
-#ifdef F_sceAudio_0002
- IMPORT_FUNC "sceAudio",0x136CAF51,sceAudioOutputBlocking
+
+#ifdef F_sceAudio_0002
+ IMPORT_FUNC "sceAudio",0x210567F7,sceAudioEnd
#endif
-#ifdef F_sceAudio_0003
- IMPORT_FUNC "sceAudio",0xE2D56B2D,sceAudioOutputPanned
+
+#ifdef F_sceAudio_0003
+ IMPORT_FUNC "sceAudio",0xA2BEAA6C,sceAudioSetFrequency
#endif
+
#ifdef F_sceAudio_0004
- IMPORT_FUNC "sceAudio",0x13F592BC,sceAudioOutputPannedBlocking
+ IMPORT_FUNC "sceAudio",0xB61595C0,sceAudioLoopbackTest
#endif
+
#ifdef F_sceAudio_0005
- IMPORT_FUNC "sceAudio",0x5EC81C55,sceAudioChReserve
+ IMPORT_FUNC "sceAudio",0x927AC32B,sceAudioSetVolumeOffset
#endif
+
#ifdef F_sceAudio_0006
- IMPORT_FUNC "sceAudio",0x41EFADE7,sceAudioOneshotOutput
+ IMPORT_FUNC "sceAudio",0x8C1009B2,sceAudioOutput
#endif
+
#ifdef F_sceAudio_0007
- IMPORT_FUNC "sceAudio",0x6FC46853,sceAudioChRelease
+ IMPORT_FUNC "sceAudio",0x136CAF51,sceAudioOutputBlocking
#endif
+
#ifdef F_sceAudio_0008
- IMPORT_FUNC "sceAudio",0xE9D97901,sceAudioGetChannelRestLen
+ IMPORT_FUNC "sceAudio",0xE2D56B2D,sceAudioOutputPanned
#endif
+
#ifdef F_sceAudio_0009
- IMPORT_FUNC "sceAudio",0xCB2E439E,sceAudioSetChannelDataLen
+ IMPORT_FUNC "sceAudio",0x13F592BC,sceAudioOutputPannedBlocking
#endif
+
#ifdef F_sceAudio_0010
- IMPORT_FUNC "sceAudio",0x95FD0C2D,sceAudioChangeChannelConfig
+ IMPORT_FUNC "sceAudio",0x5EC81C55,sceAudioChReserve
#endif
+
#ifdef F_sceAudio_0011
- IMPORT_FUNC "sceAudio",0xB7E1D8E7,sceAudioChangeChannelVolume
+ IMPORT_FUNC "sceAudio",0x41EFADE7,sceAudioOneshotOutput
#endif
+
#ifdef F_sceAudio_0012
- IMPORT_FUNC "sceAudio",0x38553111,sceAudio_38553111
+ IMPORT_FUNC "sceAudio",0x6FC46853,sceAudioChRelease
#endif
+
#ifdef F_sceAudio_0013
- IMPORT_FUNC "sceAudio",0x5C37C0AE,sceAudio_5C37C0AE
+ IMPORT_FUNC "sceAudio",0xB011922F,sceAudio_B011922F
#endif
+
#ifdef F_sceAudio_0014
- IMPORT_FUNC "sceAudio",0xE0727056,sceAudio_E0727056
+ IMPORT_FUNC "sceAudio",0xCB2E439E,sceAudioSetChannelDataLen
#endif
+
#ifdef F_sceAudio_0015
- IMPORT_FUNC "sceAudio",0x086E5895,sceAudioInputBlocking
+ IMPORT_FUNC "sceAudio",0x95FD0C2D,sceAudioChangeChannelConfig
#endif
+
#ifdef F_sceAudio_0016
- IMPORT_FUNC "sceAudio",0x6D4BEC68,sceAudioInput
+ IMPORT_FUNC "sceAudio",0xB7E1D8E7,sceAudioChangeChannelVolume
#endif
+
#ifdef F_sceAudio_0017
- IMPORT_FUNC "sceAudio",0xA708C6A6,sceAudioGetInputLength
+ IMPORT_FUNC "sceAudio",0x38553111,sceAudio_38553111
#endif
+
#ifdef F_sceAudio_0018
- IMPORT_FUNC "sceAudio",0x87B2E651,sceAudioWaitInputEnd
+ IMPORT_FUNC "sceAudio",0x5C37C0AE,sceAudio_5C37C0AE
#endif
+
#ifdef F_sceAudio_0019
- IMPORT_FUNC "sceAudio",0x7DE61688,sceAudioInputInit
+ IMPORT_FUNC "sceAudio",0xE0727056,sceAudio_E0727056
#endif
+
+#ifdef F_sceAudio_0020
+ IMPORT_FUNC "sceAudio",0x086E5895,sceAudioInputBlocking
+#endif
+
+#ifdef F_sceAudio_0021
+ IMPORT_FUNC "sceAudio",0x6D4BEC68,sceAudioInput
+#endif
+
+#ifdef F_sceAudio_0022
+ IMPORT_FUNC "sceAudio",0xA708C6A6,sceAudioGetInputLength
+#endif
+
+#ifdef F_sceAudio_0023
+ IMPORT_FUNC "sceAudio",0x87B2E651,sceAudioWaitInputEnd
+#endif
+
+#ifdef F_sceAudio_0024
+ IMPORT_FUNC "sceAudio",0x7DE61688,sceAudioInputInit
+#endif
+
+#ifdef F_sceAudio_0025
+ IMPORT_FUNC "sceAudio",0xE926D3FB,sceAudioInputInitEx
+#endif
+
+#ifdef F_sceAudio_0026
+ IMPORT_FUNC "sceAudio",0xA633048E,sceAudioPollInputEnd
+#endif
+
+#ifdef F_sceAudio_0027
+ IMPORT_FUNC "sceAudio",0xE9D97901,sceAudioGetChannelRestLen
+#endif
+
Index: src/display/pspdisplay.h
===================================================================
--- src/display/pspdisplay.h (revision 2270)
+++ src/display/pspdisplay.h (working copy)
@@ -8,6 +8,7 @@
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
* Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
+ * Copyright (c) 2007 Alexander Berl <raphael@fx-world.org>
*
* $Id$
*/
@@ -77,7 +78,7 @@
*
* @param topaddr - address of start of framebuffer
* @param bufferwidth - buffer width (must be power of 2)
- * @param pixelformat - One of ::PspDisplayPixelFormats. (only succeeds with PSP_DISPLAY_PIXEL_FORMAT_8888)
+ * @param pixelformat - One of ::PspDisplayPixelFormats.
* @param sync - One of ::PspDisplaySetBufSync
*
* @return 0 on success
Index: src/display/pspdisplay_kernel.h
===================================================================
--- src/display/pspdisplay_kernel.h (revision 2270)
+++ src/display/pspdisplay_kernel.h (working copy)
@@ -8,6 +8,7 @@
* Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
* Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
* Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
+ * Copyright (c) 2007 Alexander Berl <raphael@fx-world.org>
*
* $Id$
*/
|
And the pspmpeg.h file as it should be:
| Code: |
/*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* pspmpeg.h - Prototypes for the sceMpeg library
*
* Copyright (c) 2006 Sorin P. C. <magik@hypermagik.com>
* Copyright (c) 2007 Alexander Berl <raphael@fx-world.org>
*
* $Id$
*/
#ifndef __SCELIBMPEG_H__
#define __SCELIBMPEG_H__
#include <psptypes.h>
#ifdef __cplusplus
extern "C" {
#endif
/** points to "LIBMPEG" */
typedef ScePVoid SceMpeg;
/** some structure */
typedef SceVoid SceMpegStream;
/** Ringbuffer callback */
typedef SceInt32 (*sceMpegRingbufferCB)(ScePVoid pData, SceInt32 iNumPackets, ScePVoid pParam);
typedef struct SceMpegRingbuffer
{
/** packets */
SceInt32 iPackets;
/** unknown */
SceUInt32 iUnk0;
/** unknown */
SceUInt32 iUnk1;
/** unknown */
SceUInt32 iUnk2;
/** unknown */
SceUInt32 iUnk3;
/** pointer to data */
ScePVoid pData;
/** ringbuffer callback */
sceMpegRingbufferCB Callback;
/** callback param */
ScePVoid pCBparam;
/** unknown */
SceUInt32 iUnk4;
/** unknown */
SceUInt32 iUnk5;
/** mpeg id */
SceMpeg pSceMpeg;
} SceMpegRingbuffer;
typedef struct SceMpegAu
{
/** presentation timestamp MSB */
SceUInt32 iPtsMSB;
/** presentation timestamp LSB */
SceUInt32 iPts;
/** decode timestamp MSB */
SceUInt32 iDtsMSB;
/** decode timestamp LSB */
SceUInt32 iDts;
/** Es buffer handle */
SceUInt32 iEsBuffer;
/** Au size */
SceUInt32 iAuSize;
} SceMpegAu;
#define SCE_MPEG_AVC_FORMAT_DEFAULT -1
#define SCE_MPEG_AVC_FORMAT_5650 0
#define SCE_MPEG_AVC_FORMAT_5551 1
#define SCE_MPEG_AVC_FORMAT_4444 2
#define SCE_MPEG_AVC_FORMAT_8888 3
typedef struct SceMpegAvcMode
{
/** unknown, set to -1 */
SceInt32 iUnk0;
/** Decode pixelformat */
SceInt32 iPixelFormat;
} SceMpegAvcMode;
/**
* sceMpegInit
*
* @returns 0 if success.
*/
SceInt32 sceMpegInit();
/**
* sceMpegFinish
*/
SceVoid sceMpegFinish();
/**
* sceMpegRingbufferQueryMemSize
*
* @param iPackets - number of packets in the ringbuffer
*
* @returns < 0 if error else ringbuffer data size.
*/
SceInt32 sceMpegRingbufferQueryMemSize(SceInt32 iPackets);
/**
* sceMpegRingbufferConstruct
*
* @param Ringbuffer - pointer to a sceMpegRingbuffer struct
* @param iPackets - number of packets in the ringbuffer
* @param pData - pointer to allocated memory
* @param iSize - size of allocated memory, shoud be sceMpegRingbufferQueryMemSize(iPackets)
* @param Callback - ringbuffer callback
* @param pCBparam - param passed to callback
*
* @returns 0 if success.
*/
SceInt32 sceMpegRingbufferConstruct(SceMpegRingbuffer* Ringbuffer, SceInt32 iPackets, ScePVoid pData, SceInt32 iSize, sceMpegRingbufferCB Callback, ScePVoid pCBparam);
/**
* sceMpegRingbufferDestruct
*
* @param Ringbuffer - pointer to a sceMpegRingbuffer struct
*/
SceVoid sceMpegRingbufferDestruct(SceMpegRingbuffer* Ringbuffer);
/**
* sceMpegQueryMemSize
*
* @param Ringbuffer - pointer to a sceMpegRingbuffer struct
*
* @returns < 0 if error else number of free packets in the ringbuffer.
*/
SceInt32 sceMpegRingbufferAvailableSize(SceMpegRingbuffer* Ringbuffer);
/**
* sceMpegRingbufferPut
*
* @param Ringbuffer - pointer to a sceMpegRingbuffer struct
* @param iNumPackets - num packets to put into the ringbuffer
* @param iAvailable - free packets in the ringbuffer, should be sceMpegRingbufferAvailableSize()
*
* @returns < 0 if error else number of packets.
*/
SceInt32 sceMpegRingbufferPut(SceMpegRingbuffer* Ringbuffer, SceInt32 iNumPackets, SceInt32 iAvailable);
/**
* sceMpegQueryMemSize
*
* @param iUnk - Unknown, set to 0
*
* @returns < 0 if error else decoder data size.
*/
SceInt32 sceMpegQueryMemSize(int iUnk);
/**
* sceMpegCreate
*
* @param Mpeg - will be filled
* @param pData - pointer to allocated memory of size = sceMpegQueryMemSize()
* @param iSize - size of data, should be = sceMpegQueryMemSize()
* @param Ringbuffer - a ringbuffer
* @param iFrameWidth - display buffer width, set to 512 if writing to framebuffer
* @param iUnk1 - unknown, set to 0
* @param iUnk2 - unknown, set to 0
*
* @returns 0 if success.
*/
SceInt32 sceMpegCreate(SceMpeg* Mpeg, ScePVoid pData, SceInt32 iSize, SceMpegRingbuffer* Ringbuffer, SceInt32 iFrameWidth, SceInt32 iUnk1, SceInt32 iUnk2);
/**
* sceMpegDelete
*
* @param Mpeg - SceMpeg handle
*/
SceVoid sceMpegDelete(SceMpeg* Mpeg);
/**
* sceMpegQueryStreamOffset
*
* @param Mpeg - SceMpeg handle
* @param pBuffer - pointer to file header
* @param iOffset - will contain stream offset in bytes, usually 2048
*
* @returns 0 if success.
*/
SceInt32 sceMpegQueryStreamOffset(SceMpeg* Mpeg, ScePVoid pBuffer, SceInt32* iOffset);
/**
* sceMpegQueryStreamSize
*
* @param pBuffer - pointer to file header
* @param iSize - will contain stream size in bytes
*
* @returns 0 if success.
*/
SceInt32 sceMpegQueryStreamSize(ScePVoid pBuffer, SceInt32* iSize);
/**
* sceMpegRegistStream
*
* @param Mpeg - SceMpeg handle
* @param iStreamID - stream id, 0 for video, 1 for audio
* @param iUnk - unknown, set to 0
*
* @returns 0 if error.
*/
SceMpegStream* sceMpegRegistStream(SceMpeg* Mpeg, SceInt32 iStreamID, SceInt32 iUnk);
/**
* sceMpegUnRegistStream
*
* @param Mpeg - SceMpeg handle
* @param pStream - pointer to stream
*/
SceVoid sceMpegUnRegistStream(SceMpeg Mpeg, SceMpegStream* pStream);
/**
* sceMpegFlushAllStreams
*
* @returns 0 if success.
*/
SceInt32 sceMpegFlushAllStream(SceMpeg* Mpeg);
/**
* sceMpegMallocAvcEsBuf
*
* @returns 0 if error else pointer to buffer.
*/
ScePVoid sceMpegMallocAvcEsBuf(SceMpeg* Mpeg);
/**
* sceMpegFreeAvcEsBuf
*
*/
SceVoid sceMpegFreeAvcEsBuf(SceMpeg* Mpeg, ScePVoid pBuf);
/**
* sceMpegQueryAtracEsSize
*
* @param Mpeg - SceMpeg handle
* @param iEsSize - will contain size of Es
* @param iOutSize - will contain size of decoded data
*
* @returns 0 if success.
*/
SceInt32 sceMpegQueryAtracEsSize(SceMpeg* Mpeg, SceInt32* iEsSize, SceInt32* iOutSize);
/**
* sceMpegInitAu
*
* @param Mpeg - SceMpeg handle
* @param pEsBuffer - prevously allocated Es buffer
* @param pAu - will contain pointer to Au
*
* @returns 0 if success.
*/
SceInt32 sceMpegInitAu(SceMpeg* Mpeg, ScePVoid pEsBuffer, SceMpegAu* pAu);
/**
* sceMpegGetAvcAu
*
* @param Mpeg - SceMpeg handle
* @param pStream - associated stream
* @param pAu - will contain pointer to Au
* @param iUnk - unknown
*
* @returns 0 if success.
*/
SceInt32 sceMpegGetAvcAu(SceMpeg* Mpeg, SceMpegStream* pStream, SceMpegAu* pAu, SceInt32* iUnk);
/**
* sceMpegAvcDecodeMode
*
* @param Mpeg - SceMpeg handle
* @param pMode - pointer to SceMpegAvcMode struct defining the decode mode (pixelformat)
* @returns 0 if success.
*/
SceInt32 sceMpegAvcDecodeMode(SceMpeg* Mpeg, SceMpegAvcMode* pMode);
/**
* sceMpegAvcDecode
*
* @param Mpeg - SceMpeg handle
* @param pAu - video Au
* @param iFrameWidth - output buffer width, set to 512 if writing to framebuffer
* @param pBuffer - buffer that will contain the decoded frame
* @param iInit - will be set to 0 on first call, then 1
*
* @returns 0 if success.
*/
SceInt32 sceMpegAvcDecode(SceMpeg* Mpeg, SceMpegAu* pAu, SceInt32 iFrameWidth, ScePVoid pBuffer, SceInt32* iInit);
/**
* sceMpegAvcDecodeStop
*
* @param Mpeg - SceMpeg handle
* @param iFrameWidth - output buffer width, set to 512 if writing to framebuffer
* @param pBuffer - buffer that will contain the decoded frame
* @param iFrameNum - frame number
*
* @returns 0 if success.
*/
SceInt32 sceMpegAvcDecodeStop(SceMpeg* Mpeg, SceInt32 iFrameWidth, ScePVoid pBuffer, SceInt32* iStatus);
/**
* sceMpegGetAtracAu
*
* @param Mpeg - SceMpeg handle
* @param pStream - associated stream
* @param pAu - will contain pointer to Au
* @param pUnk - unknown
*
* @returns 0 if success.
*/
SceInt32 sceMpegGetAtracAu(SceMpeg* Mpeg, SceMpegStream* pStream, SceMpegAu* pAu, ScePVoid pUnk);
/**
* sceMpegAtracDecode
*
* @param Mpeg - SceMpeg handle
* @param pAu - video Au
* @param pBuffer - buffer that will contain the decoded frame
* @param iInit - set this to 1 on first call
*
* @returns 0 if success.
*/
SceInt32 sceMpegAtracDecode(SceMpeg* Mpeg, SceMpegAu* pAu, ScePVoid pBuffer, SceInt32 iInit);
#ifdef __cplusplus
}
#endif
#endif
|
_________________ <Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Fri Jul 20, 2007 11:11 pm Post subject: |
|
|
| Code: | Sending src/audio/pspaudio.h
Sending src/audio/sceAudio.S
Sending src/display/pspdisplay.h
Sending src/display/pspdisplay_kernel.h
Sending src/mpeg/pspmpeg.h
Transmitting file data .....
Committed revision 2271. |
Added to the repository.
I noticed that pspmpeg.h had ^M at the end of every line, so that may have been arsing up the patch process.
We really should get you your own svn access at this point, btw. :) |
|
| Back to top |
|
 |
Raphael

Joined: 17 Jan 2006 Posts: 646 Location: Germany
|
Posted: Fri Jul 20, 2007 11:34 pm Post subject: |
|
|
That would be nice :) Just PM me on what you need from me for that _________________ <Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl |
|
| Back to top |
|
 |
e_boris
Joined: 19 May 2007 Posts: 25
|
Posted: Fri Jul 27, 2007 11:35 pm Post subject: |
|
|
hi,Raphael. thanks for the updating.
but the sceAudioSetFrequency returns 1 all the time including feeding with 44100. And this call takes no effect. Waveform plays at 44100Hz always. I am using pspsdk rev2270 on PSP FW3.40A.
before that, I am using cooleyes' .a and .h. The result is that sceAudioSetFrequency crashs psp always. I think maybe I made some mistake in making the .a. |
|
| Back to top |
|
 |
Raphael

Joined: 17 Jan 2006 Posts: 646 Location: Germany
|
Posted: Sat Jul 28, 2007 12:06 am Post subject: |
|
|
Are you calling the function from within a kernel mode app? Also, are you running the CFW in 3.40 kernel mode or 1.50 kernel mode?
The problem is that the new stub is actually a kernel mode stub (ie should actually be sceAudio_driver) because the SetFrequency function is a kernel-mode only function and there isn't a user mode stub yet (I'm gonna do one asap).
EDIT: I just submitted rev 2273 which contains a pspAudio and pspAudio_driver library. So be sure you link the latter and include pspaudio_kernel.h if you want to use sceAudioSetFrequency. _________________ <Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl |
|
| Back to top |
|
 |
e_boris
Joined: 19 May 2007 Posts: 25
|
Posted: Mon Jul 30, 2007 1:33 am Post subject: |
|
|
I'm testing the app with 1.5 kernel. At the first I set the main thread in user mode. But tried setting main thread in kernel mode. The problem remains. cooleyes also tells me the same way as you told to check the problem.
I will try the new revision ASAP, thanks for your quick update. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|