Implement output, improve video/audio subsystems

- Fill in the rest of the FFmpeg test output code for testing so it
   actually properly outputs data.

 - Improve the main video subsystem to be a bit more optimal and
   automatically output I420 or NV12 if needed.

 - Fix audio subsystem insertation and byte calculation.  Now it will
   seamlessly insert new audio data in to the audio stream based upon
   its timestamp value.  (Be extremely cautious when using floating
   point calculations for important things like this, and always round
   your values and check your values)

 - Use 32 byte alignment in case of future optimizations and export a
   function to get the current alignment.

 - Make os_sleepto_ns return true if slept, false if the time has
   already been passed before the call.

 - Fix sinewave output so that it actually properly calculates a middle
   C sinewave.

 - Change the use of row_bytes to linesize (also makes it a bit more
   consistent with FFmpeg's naming as well)
This commit is contained in:
jp9000
2014-02-09 05:51:06 -07:00
parent 4461281a3b
commit 6c92cf5841
30 changed files with 500 additions and 312 deletions

View File

@@ -133,7 +133,7 @@ EXPORT void texture_destroy(texture_t tex);
EXPORT uint32_t texture_getwidth(texture_t tex);
EXPORT uint32_t texture_getheight(texture_t tex);
EXPORT enum gs_color_format texture_getcolorformat(texture_t tex);
EXPORT bool texture_map(texture_t tex, void **ptr, uint32_t *row_bytes);
EXPORT bool texture_map(texture_t tex, void **ptr, uint32_t *linesize);
EXPORT void texture_unmap(texture_t tex);
EXPORT void cubetexture_destroy(texture_t cubetex);
@@ -151,7 +151,7 @@ EXPORT uint32_t stagesurface_getwidth(stagesurf_t stagesurf);
EXPORT uint32_t stagesurface_getheight(stagesurf_t stagesurf);
EXPORT enum gs_color_format stagesurface_getcolorformat(stagesurf_t stagesurf);
EXPORT bool stagesurface_map(stagesurf_t stagesurf, const void **data,
uint32_t *row_bytes);
uint32_t *linesize);
EXPORT void stagesurface_unmap(stagesurf_t stagesurf);
EXPORT void zstencil_destroy(zstencil_t zstencil);

View File

@@ -1443,7 +1443,7 @@ enum gs_color_format texture_getcolorformat(texture_t tex)
return static_cast<gs_texture_2d*>(tex)->format;
}
bool texture_map(texture_t tex, void **ptr, uint32_t *row_bytes)
bool texture_map(texture_t tex, void **ptr, uint32_t *linesize)
{
HRESULT hr;
@@ -1459,7 +1459,7 @@ bool texture_map(texture_t tex, void **ptr, uint32_t *row_bytes)
return false;
*ptr = map.pData;
*row_bytes = map.RowPitch;
*linesize = map.RowPitch;
return true;
}
@@ -1548,7 +1548,7 @@ enum gs_color_format stagesurface_getcolorformat(stagesurf_t stagesurf)
}
bool stagesurface_map(stagesurf_t stagesurf, const void **data,
uint32_t *row_bytes)
uint32_t *linesize)
{
D3D11_MAPPED_SUBRESOURCE map;
if (FAILED(stagesurf->device->context->Map(stagesurf->texture, 0,
@@ -1556,7 +1556,7 @@ bool stagesurface_map(stagesurf_t stagesurf, const void **data,
return false;
*data = map.pData;
*row_bytes = map.RowPitch;
*linesize = map.RowPitch;
return true;
}