base_filter/videodec: set next_field_offset in caps for field structure

next_field_offset indicates the offset to the second field of Y plane
in the field structure. When a decoded image is stored as the frame
structure, this parameter is removed from caps.
base_filter: set proper data size to a GstBuffer instance when the post processing is disabled

In the post processing disabled, nFilledLen doesn't contain actual
data size but the image size assumed to be transformed with the post
processing. To figure out the actual size, we should calculate it
from nStride and nSliceHeight that are obtained from
OMX_VIDEO_PORTDEFINITIONTYPE. chroma_byte_offset has a value that is
nStride * nSliceHeight. The total data size equals chroma_byte_offset * 3 / 2.
headers: update OMX headers to 2012/10/05 RC release from REL
base_videodec: set tile height in caps for T/L addressing

Downstream plugins may be notified of the tile height when image data
is stored as tiles in memory.
base_videodec: tweak value of row stride for T/L addressing data

Tiled data output by decoder must be arranged with following a stride
value derived from the T/L addressing rule.
This tweaks the 'rowstride' value in capability if the post-processing
is disabled.
Once reinitialize an instance and then retry OMX_Init() if it fails

Reinitializing an instance in case that OMX_Init() fails may
be effective especially for some stateful OMXIL libraries since it
resets the state.
util: don't skip waiting for state change completion in error condition

REL OMXIL component can still safely transition into Idle and Loaded
states after an error occurs.
The client should wait for state change completion even when the
component returns an error.
util: move sending a pause command from flush_start to flush_stop

REL OMXIL component requires a pause command to be sent before
a flush command according to the spec. The sequence of commands to
flush the component should be grouped into g_omx_core_flush_stop()
rather than sending separately.
When g_omx_core_flush_start() is invoked, g_omx_port_pause() is
sufficient to suspend decoding when an error occurs.
util: change the beginning of locked section to definitely wakeup blocking a thread when an error occurs

When OMX_EventError is caught after OMX_SendCommand() is called and before
g_cond_timed_wait() is invoked, the thread blocks until timeout because the
wakeup signal from the event handler is sent before the thread blocks.
This change moves the mutex lock to before OMX_SendCommand() in order to
avoid this race condition.
util: don't send an omx_state_condition signal when catching an error unrelated to changing state

This signal is used in order to wakeup g_cond_timed_wait() that waits
for state change completion. When changing state fails, the signal
should be sent to force the blocking thread to wakeup. However,
the signal is sent when any error occurs, regardless of whether it
was related to changing state or not.

This patch adds a test to determine if an error is caused by changing
state so that the signal is only send when appropriate.
This test only looks at the error code, and so may cause a false
positive if an error that could be caused by a state change occurs
for some other reason.

The errors that correspond to state changes were determined by
using the REL OMXIL user manual ver.1.1 as a reference.
base_filter: set end of frame flag for buffers containing SPS/PPS, in addition to the config codec flag

The REL OMXIL specification states that the ENDOFFRAME flag should be set
for buffers containing the SPS/PPS only.
base_filter: overwrite nFlags to OMX_BUFFERFLAG_EOS when catching an EOS event

omx_buffer instances are reused after returned from the OMXIL component.
The previous nFlags should be overwritten on EOS.
util/base_filter: send an error event to application immediately after catching an error from the component

An error event might not be sent to application after catching an error
from the OMXIL component because the error event isn't sent when
EventHandler() is invoked but is sent after pad_chain() detects it.
This patch notifies the application of the error from the component
in the event handler in order to ensure that the the error is sent.
mpeg4dec: specify the video stream type as packed bitstream

REL OMXIL can be set the video stream type, which is one of the
extended parameters. This setting is necessary to decode mpeg4 streams
with packed bitstreams. Non-packed bitstreams can be decoded regardless
of the value of this setting, so it is safe to simply turn it on for
all mpeg4 streams.
This patch overrides base omx_setup() method of mpeg4dec
in order to set this param.
wmvdec: decrease the refcount of the parent object of pad

gst_pad_get_parent() increases the refcount of the parent object,
so it should be decreased with gst_object_unref().
This change invokes gst_object_unref() before each 'return' statement.