mediafoundation: Use & operator instead of GetAddressOf()

Use shorter expression

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1596>
This commit is contained in:
Seungha Yang 2022-01-27 02:26:02 +09:00
parent 36020c7549
commit ce4875ccde
3 changed files with 10 additions and 11 deletions

View file

@ -193,11 +193,11 @@ gst_mf_audio_enc_process_input (GstMFAudioEnc * self, GstBuffer * buffer)
timestamp = self->sample_count * self->sample_duration_in_mf;
hr = MFCreateSample (sample.GetAddressOf ());
hr = MFCreateSample (&sample);
if (!gst_mf_result (hr))
goto done;
hr = MFCreateMemoryBuffer (info.size, media_buffer.GetAddressOf ());
hr = MFCreateMemoryBuffer (info.size, &media_buffer);
if (!gst_mf_result (hr))
goto done;
@ -251,12 +251,12 @@ gst_mf_audio_enc_process_output (GstMFAudioEnc * self)
GstFlowReturn res = GST_FLOW_ERROR;
DWORD buffer_len = 0;
res = gst_mf_transform_get_output (self->transform, sample.GetAddressOf ());
res = gst_mf_transform_get_output (self->transform, &sample);
if (res != GST_FLOW_OK)
return res;
hr = sample->GetBufferByIndex (0, media_buffer.GetAddressOf ());
hr = sample->GetBufferByIndex (0, &media_buffer);
if (!gst_mf_result (hr))
return GST_FLOW_ERROR;

View file

@ -584,13 +584,13 @@ gst_mf_transform_process_output (GstMFTransform * self)
ComPtr < IMFMediaBuffer > buffer;
ComPtr < IMFSample > new_sample;
hr = MFCreateMemoryBuffer (out_stream_info.cbSize, buffer.GetAddressOf ());
hr = MFCreateMemoryBuffer (out_stream_info.cbSize, &buffer);
if (!gst_mf_result (hr)) {
GST_ERROR_OBJECT (self, "Couldn't create memory buffer");
return GST_FLOW_ERROR;
}
hr = MFCreateSample (new_sample.GetAddressOf ());
hr = MFCreateSample (&new_sample);
if (!gst_mf_result (hr)) {
GST_ERROR_OBJECT (self, "Couldn't create sample");
return GST_FLOW_ERROR;
@ -617,8 +617,7 @@ gst_mf_transform_process_output (GstMFTransform * self)
GST_DEBUG_OBJECT (self, "Stream change, set output type again");
hr = transform->GetOutputAvailableType (stream_id,
0, output_type.GetAddressOf ());
hr = transform->GetOutputAvailableType (stream_id, 0, &output_type);
if (!gst_mf_result (hr)) {
GST_ERROR_OBJECT (self, "Couldn't get available output type");
ret = GST_FLOW_ERROR;
@ -875,7 +874,7 @@ gst_mf_transform_open_internal (GstMFTransformOpenData * data)
ComPtr < IMFAttributes > attr;
UINT32 supports_d3d11 = 0;
hr = object->transform->GetAttributes (attr.GetAddressOf ());
hr = object->transform->GetAttributes (&attr);
if (!gst_mf_result (hr)) {
GST_ERROR_OBJECT (object, "Couldn't get attribute object");
goto done;

View file

@ -318,7 +318,7 @@ gst_mf_video_enc_set_format (GstVideoEncoder * enc, GstVideoCodecState * state)
}
#endif
hr = MFCreateMediaType (out_type.GetAddressOf ());
hr = MFCreateMediaType (&out_type);
if (!gst_mf_result (hr))
return FALSE;
@ -762,7 +762,7 @@ gst_mf_video_enc_finish_sample (GstMFVideoEnc * self, IMFSample * sample)
DWORD buffer_len;
GstClockTime pts, dts, duration;
hr = sample->GetBufferByIndex (0, media_buffer.GetAddressOf ());
hr = sample->GetBufferByIndex (0, &media_buffer);
if (!gst_mf_result (hr))
goto done;