Skip to content

Commit

Permalink
Do not to hack with OmxPortStructure
Browse files Browse the repository at this point in the history
  • Loading branch information
tigrux committed Mar 12, 2010
1 parent 88454cb commit d917ff4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 29 deletions.
18 changes: 0 additions & 18 deletions gomx.vala
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1131,24 +1131,6 @@ namespace GOmx {
} }




public void get_parameter(
uint32 param_index, Omx.PortStructure param)
throws Error requires(component !=null) {
param.port_index = index;
GOmx.try_run(
_component.handle.get_parameter(param_index, param));
}


public void set_parameter(
uint32 param_index, Omx.PortStructure param)
throws Error requires(component !=null) {
param.port_index = index;
GOmx.try_run(
_component.handle.get_parameter(param_index, param));
}


public void allocate_buffers() public void allocate_buffers()
throws Error requires(_buffers == null) { throws Error requires(_buffers == null) {
_buffers = new BufferArray(n_buffers); _buffers = new BufferArray(n_buffers);
Expand Down
9 changes: 5 additions & 4 deletions gstgomx.vala
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -253,18 +253,19 @@ namespace GstGOmx {
void configure_input() throws Error { void configure_input() throws Error {
var mp3_param = Omx.Audio.Param.Mp3(); var mp3_param = Omx.Audio.Param.Mp3();
mp3_param.init(); mp3_param.init();
input_port.get_parameter(Omx.Index.ParamAudioMp3, mp3_param); mp3_param.port_index = input_port.index;
component.handle.get_parameter(Omx.Index.ParamAudioMp3, mp3_param);
mp3_param.channels = channels; mp3_param.channels = channels;
mp3_param.sample_rate = rate; mp3_param.sample_rate = rate;
input_port.set_parameter(Omx.Index.ParamAudioMp3, mp3_param); component.handle.set_parameter(Omx.Index.ParamAudioMp3, mp3_param);
} }




void configure_output() throws Error { void configure_output() throws Error {
var pcm_param = Omx.Audio.Param.PcmMode(); var pcm_param = Omx.Audio.Param.PcmMode();
pcm_param.init(); pcm_param.init();
output_port.get_parameter(Omx.Index.ParamAudioPcm, pcm_param); pcm_param.port_index = output_port.index;

component.handle.get_parameter(Omx.Index.ParamAudioPcm, pcm_param);
src_pad.set_caps( src_pad.set_caps(
new Gst.Caps.simple( new Gst.Caps.simple(
"audio/x-raw-int", "audio/x-raw-int",
Expand Down
7 changes: 0 additions & 7 deletions omx.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -15,11 +15,4 @@
} }




typedef struct {
OMX_U32 nSize;
OMX_VERSIONTYPE nVersion;
OMX_U32 nPortIndex;
} OmxPortStructure;


#endif #endif

0 comments on commit d917ff4

Please sign in to comment.